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.
I have detected a bug when changing the variable "group_operator" using the function "set_group_operator" on "hook_views_query_alter" from "AND" to "OR"
the query remains with the value "AND"
I change the line number 1124 in the file "plugins / views_plugin_query_default.inc"
from "$main_group = db_and();"
to "$main_group = $this->group_operator == 'OR' ? db_or () : db_and ();"
and that work
Comment | File | Size | Author |
---|---|---|---|
#1 | views-use_query_group_operator_for_main_group-2543562-2.patch | 471 bytes | skylord |
|
Comments
Comment #1
skylord CreditAttribution: skylord commentedHm. Also consider this as a bug. Are there any reasons to force AND for main filter group (when arguments exist)? Here is a patch.
Comment #2
Chris Matthews CreditAttribution: Chris Matthews commentedVersion change only
Comment #3
dharizza CreditAttribution: dharizza commentedWe've been using this patch for about 4 months now and it is working great.