Bug #82046
closedFrontendRestrictionContainer mixes $tableName and $tableAlias on buildExpression calls
100%
Description
In TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer the call of buildExpression on registered restrictions uses tableName as array key and tableAlias as array value.
In all registerable restrictions these are used the other way round. The array key is used als tableAlias and the value as tableName.
This causes in wrong behaviour when tableName and tableAlias differ.
Calling DeletedRestriction::buildExpression with ['tt_content' => 't'] for example uses the 't' as tableName and 'tt_content' is taken as tableAlias. This leads to the wrong check on $GLOBALS['TCA'][$tableName]['ctrl']['delete'] where 't' is not available.
Due to a weak method call in typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendRestrictionContainerTest.php line 176 this behaviour was not discovered because
$expression = $subject->buildExpression([$tableName => $tableName], $this->expressionBuilder);
does not test with an alias that differ from the tablename.
This is happening in master and 8.7
Updated by Gerrit Code Review over 7 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/53645
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53649
Updated by Sebastian Fischer over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 79af9d6c6d31bc3b825ddb20e65144d5aa7aeec3.