- πΊπΈUnited States smustgrave
FYI please try to include interdiffs, just helps.
Ran the tests local without the fix and confirmed they failed
Failed asserting that exception of type "Drupal\Core\Database\InvalidQueryException" is thrown.I like the idea of throwing an exception.
Since this doesn't work I don't think it needs a change record. But will leave for committer to decide that.
The last submitted patch, 38: 2823910-37.patch, failed testing. View results β
The last submitted patch, 38: 2823910-37.patch, failed testing. View results β
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
This needs a change notice and a release note snippet, as the behaviour change could break sites. And for that reason we'll only commit it to 10.1.x.
I'll have a go at both.
Additionally, test providers should use keyed arrays to convey additional information in the case of a fail, that can be fixed on commit though.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
I added a change notice and added the behaviour change to the draft release notes.
-
larowlan β
committed 330d393e on 10.1.x
Issue #2823910 by daffie, pwolanin, smustgrave, dawehner, larowlan:...
-
larowlan β
committed 330d393e on 10.1.x
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Fixed on commit
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php index 621f06c24b4..798b4dc5640 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php @@ -600,15 +600,15 @@ public function testEmptyInCondition() { */ public function providerNonArrayOperatorWithArrayValueCondition() { return [ - ['=', '='], - ['>', '>'], - ['<', '<'], - ['>=', '>='], - ['<=', '<='], - ['IS NULL', 'IS NULL'], - ['IS NOT NULL', 'IS NOT NULL'], - ['', '='], - [NULL, '='], + '=' => ['=', '='], + '>' => ['>', '>'], + '<' => ['<', '<'], + '>=' => ['>=', '>='], + '<=' => ['<=', '<='], + 'IS NULL' => ['IS NULL', 'IS NULL'], + 'IS NOT NULL' => ['IS NOT NULL', 'IS NOT NULL'], + 'Empty string' => ['', '='], + 'Not set' => [NULL, '='], ]; }
Published the change record
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Needs review
over 1 year ago 4:53pm 22 May 2023 - πΊπΈUnited States neclimdul Houston, TX
I'm that person who's site was broken. I have a view argument that works in 10.0 but throws this exception in 10.1. Wouldn't that sort of behavior normally be deprecated instead of break sites on a minor release?
Compromise, if count > 1, throw exception, else trigger deprecation?
- Open on Drupal.org βEnvironment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - πΊπΈUnited States neclimdul Houston, TX
Patch with the deprecation middle ground.
- πΊπΈUnited States neclimdul Houston, TX
trying to fix the regression and provide a proper deprecation in 10.1.
- π¨π¦Canada Charlie ChX Negyesi πCanada
Add back automated IN support. ( automatic IN query support was one of several contributing factors that made SA-CORE-2014-005 easily exploitable. ).
That was in
query
and it is no reason to cripple the query builder. There was no need to do that then or now. We have added more Drupalisms and degraded DX for no reason whatsoever. The job of the query builder is to do the sensible thing and it can easily do so seeing an array. It's much harder for the string thing. - Status changed to RTBC
over 1 year ago 9:04pm 23 May 2023 - π¬π§United Kingdom catch
Since removing automatic IN() support didn't happen in this issue, putting it back should be its own issue rather than keeping going in this one.
I do think the main issue with
SA-CORE-2014-005
was committing patches from needs work at midnight on Christmas eve more than trying to support array expansion as such.#52 looks good to me. I wonder a bit if we want to trigger_error() E_USER_WARNING when count > 1 too, but if there are no known cases of this being relied upon, the exception is still clearer.
-
larowlan β
committed 485604fe on 11.x
Issue #2823910 by daffie, pwolanin, smustgrave, neclimdul, larowlan,...
-
larowlan β
committed 485604fe on 11.x
-
larowlan β
committed 7e1dcd65 on 10.1.x
Issue #2823910 by daffie, pwolanin, smustgrave, neclimdul, larowlan,...
-
larowlan β
committed 7e1dcd65 on 10.1.x
- Status changed to Fixed
over 1 year ago 10:48pm 23 May 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Committed and pushed to 11.x and cherry-picked to 10.1.x
Thanks for testing the new release before it comes out @neclimdul πͺ
Automatically closed - issue fixed for 2 weeks with no activity.