Actions
Bug #106361
openCalling Extbase Repository::findBy() with int-key array causes PHP type errors
Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2025-03-12
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
I accidently called findBy with
$user = $this->userRepository->findOneBy(['feUserId', $this->getFeUserId()]);
and the findby method was passing down the column as integer "0" all the way down to the
Typo3DbQueryParser where in line 553 there is a type error that the property name is not a string.
It took me a while of debugging why this type error was triggered. While the code I used was wrong, this
error is easy to make and a check for types should be applied earlier I feel.
The error was:
str_contains(): Argument #1 ($haystack) must be of type string, int given in /var/www/html/vendor/typo3/cms-extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php line 553
Files
Actions