Commit 8ea2cea3 authored by Simon Praetorius's avatar Simon Praetorius Committed by Jan Helke
Browse files

[BUGFIX] Remove restrictions from SQL in InstallTool

Since the context of the install tool can now be either standalone
or backend, SQL queries need to be adjusted so that Doctrine
restrictions don't change their results.

Resolves: #82360
Releases: master
Change-Id: Ic1934f06f73d6212d108658ad655228f2e983cc3
Reviewed-on: https://review.typo3.org/53976

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Matthias Vogel's avatarMatthias Vogel <typo3@kanti.de>
Tested-by: Matthias Vogel's avatarMatthias Vogel <typo3@kanti.de>
Reviewed-by: Jan Helke's avatarJan Helke <typo3@helke.de>
Tested-by: Jan Helke's avatarJan Helke <typo3@helke.de>
parent 949e4de8
......@@ -45,6 +45,8 @@ class SystemMaintainerWrite extends AbstractAjaxAction
}
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
$queryBuilder->getRestrictions()->removeAll();
$validatedUserList = $queryBuilder
->select('uid')
->from('be_users')
......
......@@ -35,9 +35,10 @@ class StartModuleUpdate extends AbstractUpdate
*/
public function checkForUpdate(&$description)
{
$statement = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('be_users')
->select(['uid', 'uc'], 'be_users', []);
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
$queryBuilder->getRestrictions()->removeAll();
$statement = $queryBuilder->select('uid', 'uc')->from('be_users')->execute();
$needsExecution = false;
while ($backendUser = $statement->fetch()) {
if ($backendUser['uc'] !== null) {
......@@ -69,6 +70,7 @@ class StartModuleUpdate extends AbstractUpdate
public function performUpdate(array &$databaseQueries, &$customMessage)
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
$queryBuilder->getRestrictions()->removeAll();
$statement = $queryBuilder->select('uid', 'uc')->from('be_users')->execute();
while ($backendUser = $statement->fetch()) {
if ($backendUser['uc'] !== null) {
......@@ -79,6 +81,7 @@ class StartModuleUpdate extends AbstractUpdate
) {
$userConfig['startModule'] = 'help_AboutAbout';
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
$queryBuilder->getRestrictions()->removeAll();
$queryBuilder->update('be_users')
->where(
$queryBuilder->expr()->eq(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment