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.
Hi,
I am facing issue on Views Filter And/Or operator. When I want to apply Or operator between 2 filters in a new group then it always takes And operator and filter result accordingly.
Steps to reproduce:
1. Create views and add 3 or 4 filters
2. Create new filter group on click to rearrange
3. Drag at least 2 filters
4. Change operator to Or and save.
Comments
Comment #2
Priyanka.addweb CreditAttribution: Priyanka.addweb at AddWeb Solution Pvt. Ltd. commentedIt works fine at my end.
Some file configuration in your drupal setting. Please check all module installation proper.
I work in drupal 8.x-3.x.
Comment #3
LendudeMoving to the right queue.
Could this be because of #2717629: Add filter group for a View fails or #2825446: Moving a filter to the end of a Filter group in filter rearrange doesn't work but does allow dropping in invalid regions?
Comment #4
suchdavid CreditAttribution: suchdavid at Integral Vision Ltd commentedHi
I experience the same problem, It happens when you have more than 2 filter group. When you have only two filter groups the operator can be changed and saved, but when you have three, when you change the first operator, it won't be saved. Changing the second operator after saving, both operator will have the value set for the second.
Probably it is not connected to rearrangement, because the problem occurs after the filters are arranged in the appropriate group and get saved. After you click on to re-edit the connection the problem arises.
Comment #5
LendudeReading this again, this sounds like a duplicate of #2865149: We should always use defined group and #2559961: ManyToOneHelper ignores group configuration for some cases. If this is a different issue, feel free to reopen.
Comment #6
plurial CreditAttribution: plurial commentedI'm facing exactly the same issue on Drupal 8.8.2. If I have two groups, I can set the operator between groups as expected. But once there is a third group, this doesn't work. Changing the operator between first two groups have no effect. Changing the operator between last two groups applies the selected operator to all operators between groups.
So in resume, as soon as there are more than two groups, the operators between groups can only be all AND or all OR. Not mixed. It's not possible to have Group1 AND Group2 OR Group3. I have the feeling that this is due to the fact that when you have a filter like
GROUP1
OPERATOR1
GROUP2
OPERATOR2
GROUP3
OPERATOR1 and OPERATOR2 dropdowns have the same name. They are both named filter_groups[operator].
Comment #7
joekersI'm facing the same issue as @plurial. It seems as though only one operator can be set between groups (
filter_groups:operator:
) so no matter how many groups there are, it will always be the same operator. I think I might be able to restructure to the filters/groups to achieve what I need to do, which isn't ideal, but I can't see something like this being changed in the module.Comment #8
kevinhbruce CreditAttribution: kevinhbruce commentedI have this same issue with 3 groups of filters—the first and/or won't save unless I change the second to "and" and then both save to "and". When I change the second and/or back to "or", the first and/or switches to "or" as well—on it's own.
Comment #9
Mohamed Nabawy CreditAttribution: Mohamed Nabawy commentedis this issue @plurial mentioned resolved in 9 or still exists as it's happening at my end with 9.3
Comment #10
vonn.new CreditAttribution: vonn.new commentedI'm still having this issue on 9.4.5