Needs work
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
exposed filters
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Sep 2009 at 03:42 UTC
Updated:
3 Sep 2014 at 09:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
markus_petrux commentedpostponing until someone can come up with a patch for review.
PS: Changing issue status helps track which issues have been already visited.
Comment #2
markus_petrux commentedActually, I think this is duplicate of #477984: CCK field is empty/not empty filter doesn't work when exposed
Comment #3
aren cambre commentedNo, this is about the UI, not about the behavior. The UI makes no sense.
Comment #4
markus_petrux commentedFor some reason I don't see a problem with the UI of the exposed filter. I see a dropdown where I can choose one of several operators, including Empty/Not empty. And a text box that is only visible depending on the operator selected. For the Empty/Not empty operator, this text box is not visible at all.
Are you using latest version of Views? ...well, I think it is Views who renders this exposed filter and it seems to me it's been fixed recently.
Comment #5
markus_petrux commentedComment #6
aren cambre commentedSee attached images.
Comment #7
markus_petrux commentedOh, I see what happens. If you check the "Unlock operator" you'll be able to change the operator in the exposed filter form, and choosing EMTPY/NOT EMPTY hides the text field. But when the "Unlock operator" option is not enabled, the exposed filter form becomes a textfield.
Well, this behavior is implemented by Views in filter handlers such as views_handler_filter_string.inc, views_handler_filter_numeric.inc, etc.
I'm not sure if this has already been reported to Views. Hopefully views maintainers can give you a better pointer on this.
Comment #8
aren cambre commentedI was going to create a separate issue for a new problem, but I found it's related to this: If I create two exposed empty/not empty filters on the same view, it looks like I get only one Apply button for both. See attached image.
I then remembered this is the single Apply button to apply all options set by the user for all filters.
This emphasizes the need for some way to toggle exposed binary filters.
Comment #9
giorgio79 commented+1
I exposed and unlocked a filter for a single on off checkbox of integer type that only has two values,
0|No
1|Yes
When I filter for EMPTY, the filter does not work.
Also,
"is empty (NULL)" or "is not empty (NULL)" should read
"is empty (NULL)" or "is not empty (NOT NULL)"
Comment #10
fatstar415 commentedPatch for this issue
Please note that this patch is not made relative to the module's root directory.
Please apply patch under the folder handlers/ in your views root directory.
Comment #11
fatstar415 commentedComment #12
giorgio79 commentedComment #13
dawehner#477984: CCK field is empty/not empty filter doesn't work when exposed
Comment #14
aren cambre commentedHmm... are you sure? This seems like a more generic version of #477984: CCK field is empty/not empty filter doesn't work when exposed.
Comment #15
dawehnerSorry. I got confused by all this patches.
Comment #16
fatstar415 commentedCopy right removed. Updated.
Comment #17
dagmarOk, it seems to be the same patch on both issues, marking as a duplicate of #477984: CCK field is empty/not empty filter doesn't work when exposed
Comment #18
mecano commentedIt is not the same issue !
This is an UI issue where exposing an "is empty" filter results in the incapacity of switching it off.
In #573298: Cannot set exposed binary filters without "Unlock operator", Aren Cambre is proposing a trinary UI but logically I guess it should be a binary UI (True/False), reset can be implemented by View Hacks, radio button would be nice (note that Better Exposed Filters doesn't seem to work here, CCK or not).
Comment #19
mattbk commentedThis issue still exists in Views 7.x-3.0-rc1. An exposed filter of "NULL" or "NOT NULL" results in a text box, not a check box as it should.
Comment #20
Shevchuk commentedStill having this issue in 7.x-3.7. A temporary (well, this issue is 3.5 years old :D) workaround would be to add a boolean field to a content type, auto-set/unset it on node update (with Rules, Conditional Fields, hook_node_presave, etc.), and use that field for exposed filter.
UPD: Found #477984: CCK field is empty/not empty filter doesn't work when exposed, and comment #60 has a patch which does exactly what we all are looking for here =)
Comment #21
anrikun commented