views_dependent_filters allows exposed filters to be hidden and to prevent the filter being included in the database query it clears the filter value.

For quite a few filter types this works fine, but for combined filters the filter is still included in the query.

For my use-case I'm using op_regex() which can be made to work as follows, similar code could be added to the other op_*() functions.

handlers/views_handler_filter_combine.inc
   function op_regex($field) {
+    if (empty($this->value)) {
+      return;
+    }
   ...
   }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MustangGB created an issue. See original summary.

MustangGB’s picture

DamienMcKenna’s picture

Status: Needs work » Needs review
MustangGB’s picture

Re-roll of #2

renatog’s picture

Status: Needs review » Reviewed & tested by the community

Yes, I agree. I applied patch #4 and it worked. If there is no $this->value it doesn't make sense to continue in the function because the method add_where_expression is expecting $args as array, so this verification is a good practice. I agree that would be great to apply this verification for other op_*() methods in the future. So moving this to RTBC

  • RenatoG committed 2221862 on 7.x-3.x authored by MustangGB
    Issue #2627480 by MustangGB, DamienMcKenna, RenatoG: Add...
renatog’s picture

Status: Reviewed & tested by the community » Fixed
Parent issue: » #3118500: Plan for Views 7.x-3.25

Moved to the dev branch. Thank you so much for your contribution @MustangGB

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.