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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

skylord’s picture

Version: 7.x-3.11 » 7.x-3.18
Status: Patch (to be ported) » Needs review
FileSize
471 bytes

Hm. Also consider this as a bug. Are there any reasons to force AND for main filter group (when arguments exist)? Here is a patch.

Chris Matthews’s picture

Version: 7.x-3.18 » 7.x-3.x-dev

Version change only

dharizza’s picture

We've been using this patch for about 4 months now and it is working great.