Data Source Record Filter - GET variable - value '0'


#1

Matrix Version: 5.4.2.1

Data source has a field using 0/1 values, I’ve set up a record filter on this field mapped to a GET parameter. Filter is Exact match.

When I access my listing page with ?flag=1, the correct subset is returned.
When I access it with ?flag=0, the entire set is returned.

I have other fields with filters set up in the same way and they work, but they use values greater than 0.

Is there any workaround that doesn’t involve changing the data set?


(Lisa) #2

Have you tried using Regex filter to match 0 exactly? e.g. /^0$/
I haven’t tested this out, I’m just thinking that Matrix is treating 0 as empty. Worth a try, before changing your dataset.


(Chiranjivi Upreti) #3

This is due to Matrix treating the dynamic variable value “0” as “value not set” and instead using the dynamic variable’s default value. I have reported this a new bug in our internal issue tracker.

Removing the default value set for that dynamic variable might work, but probably wouldn’t be a desirable workaround.