Bug #92520
closedDBAL-DriverException in BE module SYSTEM->"Backend users" when searching by username on PostgreSQL
100%
Description
Just found a bug in TYPO3 backend module SYSTEM->Backend users when using PostgreSQL. If you enter any text in the filter text field "Username" and send the search you get a Doctrine\DBAL\Exception\DriverException
.
This happens because oftypo3/sysext/beuser/Classes/Domain/Repository/BackendUserRepository.php
:
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
foreach (['userName', 'uid', 'realName'] as $field) {
$searchConstraints[] = $query->like(
$field,
'%' . $queryBuilder->escapeLikeWildcards($demand->getUserName()) . '%'
);
}
$constraints[] = $query->logicalOr($searchConstraints);
which searches for uid
(an int
column) using LIKE
which probably will fail on MSSQL and SQLite too. There is no direct replacement which is database platform agnostic to my knowledge.
As discussed on Slack we simply go for $constraints[] = $query->equals('uid', (int)$demand->getUserName());
instead to only directly show backend user 4
when searching for 4
instead of showing 4
and 14
.
Updated by Gerrit Code Review about 4 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66087
Updated by Gerrit Code Review about 4 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66118
Updated by Gerrit Code Review about 4 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66119
Updated by Stephan Großberndt about 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 80234c37d243e21fd97692611f12d01c58213f49.