Postponed (maintainer needs more info)
Project:
Search API
Version:
8.x-1.x-dev
Component:
Views integration
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Oct 2022 at 10:54 UTC
Updated:
18 Feb 2023 at 21:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #4
immaculatexavier commentedCommitted in accordance to the proposed resolution.
Comment #5
drunken monkey@ danb1974: Thanks for reporting this problem! This would be a quite serious regression.
However, our automated tests seem to run fine, and in the code it seems to me like we always take care to set
$groupto0whenever it’s empty (including''), so I’m not really sure how this might happen. Do you maybe have some code (other contrib module or custom) running on your site that adds/alters conditions by using\Drupal\search_api\Plugin\views\query\SearchApiQuery::getWhere()directly – or does some other more complex stuff with Views? Fixing that would be the smarter course of action.However, I think I didn’t really realize, when making the change, that PHP would evaluate
'' == 0toFALSE, so it does look like a bug nonetheless. The attached should fix it, treating all empty values the same here.Please test/review!
@ immaculatexavier: That’s not actually what danb1974 proposed, on the contrary, it seems like it would make the problem even worse. Also, please don’t use issue forks in this project, as the test bot doesn’t work for them (as you can see).
Comment #6
carolpettirossi commentedI couldn't apply patch #5 on latest version 1.28
Comment #7
drunken monkeyStill applies cleanly for me, both to 1.28 and dev. Could you please try again?
Otherwise, you can also make the change manually – it’s just a single line.
Comment #8
carolpettirossi commentedI'm so sorry. I was trying to apply this patch along with another one, and that's why it was failing. I could apply it successfully however it didn't solve my issue that is in fact related with something else and it is reported here: https://www.drupal.org/project/search_api/issues/3316665#comment-14788554
Comment #9
drunken monkeyDid the patch committed in #3316665: Default group type OR is ignored in SearchApiQuery::build resolve this problem for everyone here? Then we can just close.