For example if a contrib module removes an exposed filter then there will be no date value, however a where expression is still added to the query, I'd like to suggest that if there is no value the expression is not added.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MustangGB created an issue. See original summary.

MustangGB’s picture

Issue summary: View changes

Had problems with empty() so changed to is_null() instead.

MustangGB’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
3.86 KB

Okay think I've got this figured out now, back on empty(), but now testing whether filters are exposed before using exposed/session values, which happens when you had exposed filters, however then another module (e.g. views_dependent_filters) hides/removes them.

MustangGB’s picture

FileSize
3.97 KB
1.6 KB

So the behaviour of #3 is:
a) Filter not exposed -> Query added with default value
b) Filter exposed -> Query added with filter value
c) Filter exposed then removed -> Query added with default value

I think in the instance of (c) the intention is that the default value is used as the default value of the exposed filter only, and if the filter is removed then the filter/default value should be ignored completely.

So the behaviour of #4 is (changes in bold):
a) Filter not exposed -> Query added with default value
b) Filter exposed -> Query added with filter value
c) Filter exposed then removed -> Query not added

MustangGB’s picture

FileSize
4.05 KB

Latest version.

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll, +Needs rework

The 2 year old patch in #5 to date_views_filter_handler_simple.inc does not apply to the latest 7.x-2.x-dev and will need to be rerolled.

Checking patch date_views/includes/date_views_filter_handler_simple.inc...
Hunk #1 succeeded at 117 (offset 17 lines).
error: while searching for:
  }

  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);

error: patch failed: date_views/includes/date_views_filter_handler_simple.inc:131
error: date_views/includes/date_views_filter_handler_simple.inc: patch does not apply