Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Apr 2007 at 09:03 UTC
Updated:
11 Dec 2008 at 17:53 UTC
I'm getting desperate trying to find some way to filter nodes with empty date fields (a IS NULL query for the date field of a table). I have a content type named "projects" and I need to generate a list of "active" projects: those that have been started but haven't been finished yet (in other words, those that have the "Ended on:" date field empty.
I've been playing around with the operators trying combinations like IS EQUAL TO IS NULL or IS EQUAL TO 'IS NULL', and even IS NOT EQUAL TO '%' without any success.
Can anybody help?
Comments
Comment #1
yched commentedThis would be a request for date.module.
And more generally there are similar requests for texts.module, imagefield.module, etc...
The goal of the patch in http://drupal.org/node/101050 is to provide this as a general features for all field types.
Reviews needed :-)
Comment #2
leonardo.ruffini commentedThank you, yched. Now I know I'm not alone on this! Going to that patch.
Comment #3
executex commentedIs there a reason why Views developers don't actually patch this? I don't know how to use your patches, and I don't understand after 2 years how Views could not have patched it in one of their releases? Or CCK...
Is there any developers left for CCK or Views? Or they have other things to worry about?
Comment #4
yched commentedBasically, the answer is : this has been solved in the Views 2 / CCK 2 combo.
Doing this cleanly required structural changes both on the Views side and on the CCK side. so a D5 backport probably won't happen.
Comment #5
executex commentedWow... so a simply isEmpty() cannot be back-ported... That must be a serious design flaw.
Comment #6
merlinofchaos commentedYes, Views 1 has some serious design flaws. This is why Views 2 even exists.
Comment #7
domesticat commented@yched - are you sure #101050: empty / not empty filter for Views worked for date fields? Filtering for [null | is not null] looks like it was fixed in Views 2 for most fields, but if it was fixed for date fields, I'm at a loss for how to do it.
After reading through #101050: empty / not empty filter for Views and playing with filters, I saw where the null / not null options were available for other field types, but couldn't work out how to do an equivalent for date fields.
There was some activity on #312403: Can't check for IS NULL / NOT NULL when adding filter for date two days ago, providing a patch that specifically enabled null / not null testing on date fields. It works for me, but I'm not conversant enough with the code behind Views to know if it's good enough to qualify as RTBC.
While this isn't the version of core that @leonardo.ruffini was working on, it might help answer his original question.