[TASK] Doctrine: Migrate InfoPageTyposcriptConfigController 82/48482/6
authorXavier Ley <xavierley@gmail.com>
Tue, 7 Jun 2016 12:46:26 +0000 (14:46 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 7 Jun 2016 17:34:10 +0000 (19:34 +0200)
Resolves: #76484
Releases: master
Change-Id: Id05fdea7894693ba129127aef1999901a8a0bf6c
Reviewed-on: https://review.typo3.org/48482
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/info_pagetsconfig/Classes/Controller/InfoPageTyposcriptConfigController.php

index bb966a5..c425145 100644 (file)
@@ -15,6 +15,9 @@ namespace TYPO3\CMS\InfoPagetsconfig\Controller;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Database\ConnectionPool;
+use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
+use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -233,15 +236,22 @@ class InfoPageTyposcriptConfigController extends \TYPO3\CMS\Backend\Module\Abstr
      */
     protected function getOverviewOfPagesUsingTSConfig()
     {
-        $db = $this->getDatabaseConnection();
-        $res = $db->exec_SELECTquery(
-            'uid, TSconfig',
-            'pages',
-            'TSconfig != \'\''
-            . BackendUtility::deleteClause('pages')
-            . BackendUtility::versioningPlaceholderClause('pages'), 'pages.uid');
-        $pageArray = array();
-        while ($row = $db->sql_fetch_assoc($res)) {
+        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages');
+        $queryBuilder->getRestrictions()
+            ->removeAll()
+            ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
+            ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
+
+        $res = $queryBuilder
+            ->select('uid', 'TSconfig')
+            ->from('pages')
+            ->where($queryBuilder->expr()->neq('TSconfig', $queryBuilder->quote('')))
+            ->groupBy('uid')
+            ->execute();
+
+        $pageArray = [];
+
+        while ($row = $res->fetch()) {
             $this->setInPageArray($pageArray, BackendUtility::BEgetRootLine($row['uid'], 'AND 1=1'), $row);
         }
         return $this->getList($pageArray);