[BUGFIX] Add query restrictions for all tables in query 02/51902/5
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Tue, 28 Feb 2017 15:51:01 +0000 (16:51 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 1 Mar 2017 08:26:06 +0000 (09:26 +0100)
commitaa3396080bc70d9ee15c3dbff9a6a9dc4c79204f
treecd66b1c18472b5295525175030a08255f8703e19
parent3b4d288cc863cb614d8e19ed0ed85dd9f0814d94
[BUGFIX] Add query restrictions for all tables in query

QueryBuilder::getQueriedTables now returns an array with table
alias as a key and table name as value.
If a table doesn't have an alias, both key and value are containing
table name.

This change is needed to make query restriction classes add restrictions
for all tables in case the self inner join is made.
A test covering the case was added to QueryBuilderTest.

Releases: master
Resolves: #79615
Change-Id: Ibf797189334ed86db0fce1a4ef3f0898cb0ada11
Reviewed-on: https://review.typo3.org/51902
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Patrick Broens <patrick@patrickbroens.nl>
Tested-by: Patrick Broens <patrick@patrickbroens.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
22 files changed:
typo3/sysext/core/Classes/Database/Query/QueryBuilder.php
typo3/sysext/core/Classes/Database/Query/Restriction/AbstractRestrictionContainer.php
typo3/sysext/core/Classes/Database/Query/Restriction/BackendWorkspaceRestriction.php
typo3/sysext/core/Classes/Database/Query/Restriction/DeletedRestriction.php
typo3/sysext/core/Classes/Database/Query/Restriction/EndTimeRestriction.php
typo3/sysext/core/Classes/Database/Query/Restriction/FrontendGroupRestriction.php
typo3/sysext/core/Classes/Database/Query/Restriction/FrontendRestrictionContainer.php
typo3/sysext/core/Classes/Database/Query/Restriction/FrontendWorkspaceRestriction.php
typo3/sysext/core/Classes/Database/Query/Restriction/HiddenRestriction.php
typo3/sysext/core/Classes/Database/Query/Restriction/RootLevelRestriction.php
typo3/sysext/core/Classes/Database/Query/Restriction/StartTimeRestriction.php
typo3/sysext/core/Tests/Unit/Database/Query/QueryBuilderTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/BackendWorkspaceRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/DefaultRestrictionContainerTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/DeletedRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/EndTimeRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendGroupRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendRestrictionContainerTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendWorkspaceRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/HiddenRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/RootLevelRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/StartTimeRestrictionTest.php