diff --git a/date_views/includes/date_views_filter_handler_simple.inc b/date_views/includes/date_views_filter_handler_simple.inc index 4fa4c40..4b71c62 100644 --- a/date_views/includes/date_views_filter_handler_simple.inc +++ b/date_views/includes/date_views_filter_handler_simple.inc @@ -130,6 +130,20 @@ class date_views_filter_handler_simple extends views_handler_filter_date { } + function op_empty($field) { + list($table_name, $field_name) = explode('.', $field); + if (substr($field_name, -7) == '_value2') { + $value_field = $table_name . '.' . substr($field_name, 0, -7) . '_value'; + if ($this->operator == 'empty') { + $this->query->add_where_expression($this->options['group'], "$field = $value_field OR $field IS NOT NULL "); + } else { + $this->query->add_where_expression($this->options['group'], "$field <> $value_field AND $field IS NOT NULL "); + } + } else { + parent::op_empty($field); + } + } + function op_between($field) { // Add the delta field to the view so we can later find the value that matched our query.