[BUGFIX] Remove restrictions from SQL in InstallTool 76/53976/2
authorSimon Praetorius <simon@praetorius.me>
Thu, 7 Sep 2017 20:30:27 +0000 (22:30 +0200)
committerJan Helke <typo3@helke.de>
Fri, 8 Sep 2017 16:09:10 +0000 (18:09 +0200)
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: TYPO3com <no-reply@typo3.com>
Reviewed-by: Matthias Vogel <typo3@kanti.de>
Tested-by: Matthias Vogel <typo3@kanti.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
typo3/sysext/install/Classes/Controller/Action/Ajax/SystemMaintainerWrite.php
typo3/sysext/install/Classes/Updates/StartModuleUpdate.php

index ecded37..ebfe020 100644 (file)
@@ -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')
index f270362..7f0f688 100644 (file)
@@ -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(