This bug seems to only happen when testing a Contextual Flilter via the "Preview" functions of Views. When the View is actually called as a page, the Views query is assembled as expected.
If you create a contextual filter on virtually any field in Drupal Views and pass a filter value of "0" in, Views Preview follows the behavior specified in "WHEN THE FILTER VALUE IS NOT IN THE URL" (tested on numerical and text). In other words, it resolves "0" to be null. Below is a set of screen shots tested against the "Article" node. I created two nodes, one with the title "1" and the other with the title "0". Both are accepted as legitimate titles by Drupal, so I think Views should handle them. Image 1 shows the result with a contextual filter of "1", works as expected. A contextual filter of "0", however, returns all records and the query shows that Views assumes no filter has been submitted.
Image 1: No filter value submitted
Image 2: Filter value "1" submitted
Image 3: Filter value "0" submitted
I am working on finding where this is handled so that I might submit a patch - any pointers would be appreciated.
Comment | File | Size | Author |
---|---|---|---|
zero_filter_0.png | 19.98 KB | robertwb | |
zero_filter_1.png | 20.78 KB | robertwb | |
zero_filter_all.png | 19.51 KB | robertwb |
Comments
Comment #1
MustangGB CreditAttribution: MustangGB commentedClosing this as outdated, feel free to re-open with updated details if it's still a problem in the latest release.