Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298397

ManyToOneHelper ignores group configuration for some cases

$
0
0

Bug description

We've met a buggy behaviour of a view having two reference-field filters in an OR subgroup.

That's how filters looked like:

And this is the resulting query:

There are two issues:
1. AND operator is used instead of OR one.
This is from hardcoded group identifier- value of 0 - for building adding where expression addWhereExpression which in some case will fail ... if the group is other than 0.
2. Even if OR operator would be used, INNER join breaks the OR logic.
The fix for this was included in the latest MR, originally it was being handled separately in #1766338: Incorrect filter group OR behavior, LEFT JOIN changed to INNER JOIN
This is from forcing INNER join - for performance - even the operator is OR for the current group.

Steps to reproduce

  1. Create 2 taxonomies
    and add some terms for both of vocabularies
  2. Create 2 taxonomy term reference fields
    And create different content
  3. Create a view with 2 filters for those 2 fields
  4. Play with AND and OR operators for those filters

Proposed resolution

on ManyToOneHelper

  • - Fix addWhereExpression usage by using the current option group
  • - Use INNER join only there is no OR operator for the current group

STR

1. Create new Drupal 8 installation with a Standard profile.
2. Export configuration.
3. Copy/replace files from attached configuration-parts.tgz.
4. Import/synchronize the configuration.
5. At admin/structure/views/settings enable the "Show the SQL query" option.
6. Visit admin/structure/views/view/many_to_one_test and see the resulting query.

Remaining tasks

- decide if we want to somehow determine when the INNER join can be used


Viewing all articles
Browse latest Browse all 298397

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>