Project

General

Profile

Actions

Bug #82046

closed

FrontendRestrictionContainer mixes $tableName and $tableAlias on buildExpression calls

Added by Sebastian Fischer over 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2017-08-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Actions #1

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

Actions #2

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

Actions #3

Updated by Sebastian Fischer over 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF