diff --git a/date_views/includes/date_views_filter_handler_simple.inc b/date_views/includes/date_views_filter_handler_simple.inc index 4fa4c40..356a30d 100644 --- a/date_views/includes/date_views_filter_handler_simple.inc +++ b/date_views/includes/date_views_filter_handler_simple.inc @@ -128,10 +128,24 @@ class date_views_filter_handler_simple extends views_handler_filter_date { } return parent::accept_exposed_input($input); } + 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 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. list($table_name, $field_name) = explode('.', $field); if (!empty($this->options['add_delta']) && (substr($field_name, -6) == '_value' || substr($field_name, -7) == '_value2')) {