If I set filter to show me dates not from some interval, filter doesn't show me NULL values.
Of course I can add another OR filter which shows me NULL values, but it can't work with more than one field.

CommentFileSizeAuthor
#3 date_api_filter_handler.patch512 bytesi.gajic

Comments

cpall’s picture

I need this as well. I hacked - and I do mean hacked -- it into the query() function in the date_api_filter_handler.inc --- by tacking on a little piece of SQL like so:

if ($sql)
  $sql .= ' OR '.$query_field['field']['fullname'].' IS NULL';

/forgive me, I know not what I do
//I also have no idea how to make a patch

cpall’s picture

As a sidenote, obviously, this tacks an OR for every date field filter that is setup. It would be far better to add in an option to include it per filter.

i.gajic’s picture

StatusFileSize
new512 bytes

After some digging trough source code of date filter handler file, I've found that option 'Include NULL values' is completely ignored by the query() function. But this option is very useful in some situation, i.e. when date field is not mandatory, it can hold value or be NULL, and you want to check if date meets constraints or it is not set.

cpall gave me idea to change generated query and to create patch.

damienmckenna’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Unfortunately the Drupal 6 version of the Date module is no longer supported. That said, we appreciate that you took time to work on this issue. Should this request still be relevant for Drupal 7 please feel free to reopen it. Thank you.