Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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;
+ }
...
}
Comment | File | Size | Author |
---|---|---|---|
#4 | views-2627480-4.patch | 604 bytes | MustangGB |
| |||
#2 | views-2627480-2.patch | 591 bytes | MustangGB |
Comments
Comment #2
MustangGB CreditAttribution: MustangGB commentedComment #3
DamienMcKennaComment #4
MustangGB CreditAttribution: MustangGB commentedRe-roll of #2
Comment #5
renatogYes, 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
Comment #7
renatogMoved to the dev branch. Thank you so much for your contribution @MustangGB