- First commit to issue fork.
- Merge request !4081Issue #1766338: Incorrect filter group OR behavior, LEFT JOIN changed to INNER JOIN β (Closed) created by vasike
- last update
over 1 year ago Custom Commands Failed - Status changed to Needs review
over 1 year ago 7:05am 31 May 2023 - π·π΄Romania vasike Ramnicu Valcea
new MR available
the condition to useINNER
for join: Only if there is no group with OR operator.
LEFT JOIN
it's by default.However this will not work without the solution for https://www.drupal.org/project/drupal/issues/2559961 π ManyToOneHelper ignores group configuration for some cases Fixed
which means that it can be really tested.And a scenario to reproduce.
1. Create 2 taxonomies
and add some terms
2. Create 2 taxonomy term reference fields
And create different content
3. Create a view with 2 filters for those 2 fields
4. Play withAND
andOR
operators for those filtersAgain the patch from https://www.drupal.org/project/drupal/issues/2559961 π ManyToOneHelper ignores group configuration for some cases Fixed it's needed in terms to get the right results.
p.s. i have no idea why those 2 issues were separated.
- last update
over 1 year ago 29,402 pass - π·π΄Romania vasike Ramnicu Valcea
Tests available on related ticket MR
please check
https://www.drupal.org/project/drupal/issues/2559961#comment-15085241 π ManyToOneHelper ignores group configuration for some cases Fixed - Status changed to Needs work
over 1 year ago 2:36pm 31 May 2023 - πΊπΈUnited States smustgrave
If this ticket isn't going to add tests and be dependent on another. Then it should be postponed.
But even then I think the tests should be different, as the tests on π ManyToOneHelper ignores group configuration for some cases Fixed should be testing that issue. If the tests are testing the same thing then these tickets would be dups of each other.
- Status changed to Closed: duplicate
over 1 year ago 3:36pm 14 June 2023 - π·π΄Romania vasike Ramnicu Valcea
As the solution and tests are in the MR of the related issue ... i would say this is kind of duplicate.
closed also the MR ... test can't be added without the solution from related issue.
- Status changed to Needs review
8 months ago 5:32pm 8 April 2024 - π¬π§United Kingdom SoulReceiver
This is still an issue, but apply the code in the merge request worked very nicely. Can this be rereviewed?
- Status changed to Postponed: needs info
8 months ago 5:39pm 8 April 2024 - πΊπΈUnited States smustgrave
As is the MR can't be merged as it's closed and No test coverage
If this ticket were to continue issue summary would have to be updated to standard template.
But would see if related issue that this was closed for solves the issue, depending on core version you are on.
- π¬π§United Kingdom SoulReceiver
Currently running Drupal 10.2.4, and when creating a View and adding an OR condition of two taxonomy fields, the resulting JOIN's on these tables remains as an INNER rather than a LEFT:
- Status changed to Needs review
8 months ago 9:38am 9 April 2024 - π·π΄Romania vasike Ramnicu Valcea
It seems the changes for this issue were not included in the related issue commits.
So i re-opened the MR and added the tests code from there.
i think we are back to review. - Status changed to Needs work
8 months ago 10:30am 9 April 2024 - π¬π§United Kingdom longwave UK
Thanks for reviving this and adding some tests.
However, the tests pass with or without the change, see https://git.drupalcode.org/issue/drupal-1766338/-/jobs/1278007 - so are they testing the correct thing?
- Status changed to Needs review
8 months ago 4:31pm 11 April 2024 - π·π΄Romania vasike Ramnicu Valcea
@longwave thank you for the "guidance"
Also @SoulReceiver comments helped.
i remembered some things about this issue.indeed the previous tests added tried for the related issue which actually solved this specific case when we have multiple "Has taxonomy term" filters.
And this multiple uses will bring "LEFT JOIN" from the second filter .. which means the tests will pass anyway.The trick ... having the second taxonomy filter as "field filter". It still uses the "
taxonomy_index_tid
" filter plugin so, I think we're still in the right place and (+) it adds and extra test for taxonomy fields.
Also removed some tests that weren't that relevant here.https://git.drupalcode.org/issue/drupal-1766338/-/jobs/1304700
I'm more than aware it's not the perfect/complete solution for the fix ... but at least it could save the day.
To save the (Views Filter Grouping) Universe ... I think another issue is needed ... starting maybe with some kernel tests about those FIlters GROUPING JOINS.p.s. Views and tests needs a lot of efforts ... still
- Status changed to Needs work
8 months ago 5:51pm 12 April 2024 - πΊπΈUnited States smustgrave
Can the issue summary be updated using standard template.
Original issue appears to have been written for D7.
- Status changed to Needs review
8 months ago 11:49am 15 April 2024 - Status changed to RTBC
8 months ago 2:20pm 15 April 2024 - πΊπΈUnited States smustgrave
Issue summary appears much better
Ran test-only feature
There was 1 error: 1) Drupal\Tests\taxonomy\Functional\Views\TaxonomyIndexTidUiTest::testFilterGrouping Behat\Mink\Exception\ResponseTextException: Failed asserting that the page matches the pattern '/ioy19583/ui' 1 time(s), 0 found. Failed asserting that 0 is identical to 1. /builds/issue/drupal-1766338/core/tests/Drupal/Tests/WebAssert.php:734 /builds/issue/drupal-1766338/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php:547 /builds/issue/drupal-1766338/vendor/phpunit/phpunit/src/Framework/TestResult.php:729 ERRORS! Tests: 5, Assertions: 242, Errors: 1.
So shows coverage.
Manually testing following the steps I believe I am seeing the issue.
s an exposed filter with 'Is one of', twice
I probably would of just used one filter selecting the multiple options but maybe can understand scenarios were you would do it this way.
Change to ManyToOneHelper makes sense.
12 years wow, good job on this one!
- π¬π§United Kingdom alexpott πͺπΊπ
I've tried to credit people who helped move this issue on and have been thanked on the issue for their contributions. Obviously with so many comments this can be hard to get right - hopefully I have. Please let me know if I've not.
- Status changed to Fixed
8 months ago 11:30pm 16 April 2024 - π¬π§United Kingdom alexpott πͺπΊπ
Committed and pushed 0dac7cab32 to 11.x and 1c95773ffe to 10.3.x and c1c3ae32ca to 10.2.x. Thanks!
-
alexpott β
committed c1c3ae32 on 10.2.x
Issue #1766338 by vasike, John Pitcairn, sagesolutions, jenlampton,...
-
alexpott β
committed c1c3ae32 on 10.2.x
-
alexpott β
committed 1c95773f on 10.3.x
Issue #1766338 by vasike, John Pitcairn, sagesolutions, jenlampton,...
-
alexpott β
committed 1c95773f on 10.3.x
-
alexpott β
committed 0dac7cab on 11.x
Issue #1766338 by vasike, John Pitcairn, sagesolutions, jenlampton,...
-
alexpott β
committed 0dac7cab on 11.x
Automatically closed - issue fixed for 2 weeks with no activity.