Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Views Data
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2009 at 11:40 UTC
Updated:
27 Mar 2010 at 01:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
dawehneri would like perhaps to have this also as a option for gui.
This would be for sure a simple patch for this patch :)
PS: the patch should be out of views root dir.
Comment #2
voxpelli commented@dereine: I'm not sure how it would fit in the gui. The handlers are used to describe data for views and whether to treat null as false or not depends on the data structure which I believe the gui never has any part in defining? Can you give an example of how it could fit in the gui?
If I need to reroll the patch out of the views module I'll do that later when I'm back at work.
Comment #3
dawehnerUpdated i developed one simplehandler for a custom module using this feature and it worked as expected
Query before
Query after:
i think the difference is easy to see
Comment #4
merlinofchaos commentedIn definitions, I try to avoid underscores. So it should be 'accept null' rather than 'accept_null'.
I'm trying to decide if I would want a checkbox or not to accept NULL, but I think I'm agreeing that it does not need to be a UI element.
Comment #5
voxpelli commentedRerolling the patch with 'accept null' - it became the wrong patch this time as well. I'm making the patch through git so I probably needs to generate it with some other settings - have to look that up.
Not considering the path in my patch - does it work well or do I really need to improve on the style of them? What do you think merlinofchaos?
Comment #6
merlinofchaos commentedCommited to 2.x and 3.x branches.
Comment #8
fonant commentedThis is broken in the released Views code, but is useful for me: I also want to filter on whether a related table field exists or is NULL, so I can filter on the existence of the cross-table link.
The released code tests for the configuration setting with:
if (isset($this->definition['accept_null']))but then uses the value of the setting without the underscore:
$this->accept_null = (bool) $this->definition['accept null'];The fix is trivial: remove the underscore from the test string.
The workaround is simply to add both 'accept null' and 'accept_null' if you need this set to TRUE in hook_views_data().
Comment #9
fonant commentedComment #10
dawehnerHere is a patch
Comment #11
EPO commentedThe same problem occurs when using a negativ argument filter i.e. checking "exclude argument". If there are null values in the column the null rows are regarded as having(!) the excluded value. This is commonly not desired.
The SQL Code is
... WHERE field != 'x' ...
and should be
... WHERE field != 'x' OR field IS NULL
Sorry, but I am not responsible for his ugly SQL behaviour.
Comment #12
merlinofchaos commentedAfter consideration, #11 is separate from this issue, though it's similar. That issue is about arguments, and the patch here is about filters.
Comment #13
merlinofchaos commented#10 committed to all branches.