- ๐ฆ๐บAustralia acbramley
Triaged as part of BSI, bug still exists in 11.x
- Status changed to Needs review
over 1 year ago 1:01am 8 September 2023 - Open on Drupal.org โEnvironment: PHP 8.2 & MySQL 8last update
over 1 year ago Waiting for branch to pass - Open on Drupal.org โEnvironment: PHP 8.2 & MySQL 8last update
over 1 year ago Waiting for branch to pass - ๐ฆ๐บAustralia acbramley
I feel like the correct solution is
array $constructor_arguments = []
, but that may require a BC dance which it looks like these classes have already been through. - Status changed to Needs work
over 1 year ago 2:52am 8 September 2023 - ๐ฆ๐บAustralia kim.pepper ๐โโ๏ธ๐ฆ๐บSydney, Australia
+++ b/core/lib/Drupal/Core/Database/StatementWrapperIterator.php @@ -217,7 +217,7 @@ public function fetchAssoc() { public function fetchObject(string $class_name = NULL, array $constructor_arguments = NULL) {
I think it would be better to update fetchObject() to default to an empty array and trigger a deprecation warning if NULL is passed.
- Status changed to Needs review
over 1 year ago 3:51am 8 September 2023 - last update
over 1 year ago 30,147 pass The last submitted patch, 7: 3259740-7--test-only.patch, failed testing. View results โ
- Status changed to Needs work
over 1 year ago 3:44pm 8 September 2023 - ๐บ๐ธUnited States smustgrave
Think #9 would be the safest. A trigger_error if null is passed in.
- Status changed to Needs review
over 1 year ago 3:39am 9 September 2023 - ๐ฆ๐บAustralia acbramley
Explicitly passing NULL produces a similar error, therefore does not need a deprecation because it never worked in the first place.
TypeError: PDOStatement::fetchObject(): Argument #2 ($constructorArgs) must be of type array, null given in PDOStatement->fetchObject()
- Status changed to RTBC
over 1 year ago 8:41pm 9 September 2023 - last update
over 1 year ago 30,123 pass, 4 fail The last submitted patch, 7: 3259740-7--test-only.patch, failed testing. View results โ
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
Going to ping daffie for a review
- Status changed to Needs work
over 1 year ago 7:37am 11 September 2023 - ๐ณ๐ฑNetherlands daffie
I think we need to add a deprecation warning when the second parameter is explicitly set to NULL and add testing for that.
- ๐ณ๐ฑNetherlands daffie
I did the review, therefor I should have removed the tag.
- Status changed to Needs review
over 1 year ago 11:46pm 11 September 2023 - ๐ฎ๐นItaly mondrake ๐ฎ๐น
Shouldnโt we fully align to the signature since weโre at it?
public PDOStatement::fetchObject(?string $class = "stdClass", array $constructorArgs = []): object|false
Maybe without the return typehint for now.
Not sure where we are with BC here - the interface is not typehinted yet, but concrete classes are and contrib extending from them would fail.
- Status changed to RTBC
over 1 year ago 11:21am 15 September 2023 - ๐ณ๐ฑNetherlands daffie
After talking to @acbramley and @larowlan on Slack, do I get their point. The parent method from PHP PDO also does not work when the second parameter is set to NULL. Therefor that is not a BC break.
Not sure where we are with BC here - the interface is not typehinted yet, but concrete classes are and contrib extending from them would fail.
Yes this would be a BC break. We have 2 contrib database drivers (MySQLi and MS SQL Server). The first one is being integrated in Drupal core and the second one does not override the method. I do not know of any other contrib overrides for the method and http://grep.xnddx.ru is no longer working. I do not know of any other alternatives.
If there are any overrides it will be very few instances. For me it is an exceptable risk. I leave it up to committer to make up his/her own mind and make the final decession. Back to RTBC. - last update
over 1 year ago 30,145 pass, 2 fail The last submitted patch, 7: 3259740-7--test-only.patch, failed testing. View results โ
- last update
over 1 year ago 30,159 pass - last update
over 1 year ago 30,159 pass - last update
over 1 year ago 30,159 pass - last update
over 1 year ago 30,162 pass -
larowlan โ
committed 4dba7727 on 11.x
Issue #3259740 by acbramley, daffie: PDOStatement::fetchObject() expects...
-
larowlan โ
committed 4dba7727 on 11.x
- Status changed to Fixed
over 1 year ago 8:52pm 18 September 2023 - ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
Committed to 11.x
Created and published a change record
Automatically closed - issue fixed for 2 weeks with no activity.