Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Jun 2009 at 18:03 UTC
Updated:
8 Apr 2010 at 17:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
electricmonk commentedSame behavior here - CCK Number field with 2 possible values - 0 or 1, adding an argument and it translates to IS NULL when the value is 0.
Comment #2
electricmonk commentedOK, the problem is in Views, file views_handler_argument_many_to_one.inc. Moving this to Views and adding a patch which seems to work - please review and check that it didn't interfere with any expected behavior.
Comment #3
merlinofchaos commentedI think this may break the 'Uncategorized' item for taxonomy. In order to be fixed properly, this probably needs a setting in the definition so that things like taxonomy can keep using 0 for uncategorized, and other systems can have a 0 as an actual value.
Comment #4
m_z commentedMaybe this issue is a duplicate of http://drupal.org/node/296732
But especially if this unwanted behaviour comes with a (numeric) checkbox field, then I found a workaround that I post here because this issue is dealing with checkboxes.
If your argument will run through basic validation (not validation option 'numeric') then a given argument string like '0' or any other string will result in the correct WHERE condition.
This is due to replacement of your given string to 0 when the replacement for %d placeholder in db_query() function is running.
Comment #5
sphopkins commentedIs this issue related to #559102: Views thinks that a 0 value is empty even when the box 'Count the number 0 as empty' is unchecked... ?
Still struggling with that one.
Comment #6
m_z commented@shopkins (#5):
I am not sure if both issues are related: this issue is dealing with an argument handler, but #559102 is dealing with a field handler (and there is a new patch).
Comment #7
sphopkins commentedYeah looking to test that patch http://drupal.org/node/559102#comment-2495742 today or tomorrow...
Comment #8
dawehnerHere comes a patch. I did not tested the patch well.
Comment #9
merlinofchaos commentedOh man. Mixing spaces and _ in a definition term is going to confuse people.
Also as with a previous patch I marked 'needs work' the command needs to be documented in the doxygen at the top of the class.
Otherwise this looks very promising.
Comment #10
dawehnerYeah this was shit. Here is an update with class documentation
Comment #11
merlinofchaos commentedHooray to see this fixed! COmmitted to all branches.
Comment #12
jvandooren commentedWarning: this change is not yet included in the current 6.x-2.8 version (it is in the 6.x-2.x-dev).
If anyone wants to apply the patch mentioned in comment #10: there is a small bug in the patch.
Change
To
Notice the exclamation mark... This is correct in 6.x-2.x-dev.
Comment #13
merlinofchaos commentedReleases are static; 2.8 won't be changed, so it won't ever be included in 2.8. It will be included in 2.9 when we roll another release.