[TASK] Doctrine: migrate ext:backend/RecordList 72/47672/5
authorJan Helke <typo3@helke.de>
Thu, 14 Apr 2016 15:44:28 +0000 (17:44 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Tue, 7 Jun 2016 08:30:59 +0000 (10:30 +0200)
Releases: master
Resolves: #75624
Change-Id: I0ef6bc952e0f74315ce3b4ef3f841721240ef814
Reviewed-on: https://review.typo3.org/47672
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Classes/RecordList/AbstractRecordList.php

index 6f788f9..4377afb 100644 (file)
@@ -18,7 +18,10 @@ use TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider;
 use TYPO3\CMS\Backend\Routing\Router;
 use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
+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;
@@ -425,7 +428,23 @@ abstract class AbstractRecordList
     public function initializeLanguages()
     {
         // Look up page overlays:
-        $this->pageOverlays = $this->getDatabaseConnection()->exec_SELECTgetRows('*', 'pages_language_overlay', 'pid=' . (int)$this->id . BackendUtility::deleteClause('pages_language_overlay') . BackendUtility::versioningPlaceholderClause('pages_language_overlay'), '', '', '', 'sys_language_uid');
+        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
+            ->getQueryBuilderForTable('pages_language_overlay');
+        $queryBuilder->getRestrictions()
+            ->removeAll()
+            ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
+            ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
+        $result = $queryBuilder
+            ->select('*')
+            ->from('pages_language_overlay')
+            ->where($queryBuilder->expr()->eq('pid', (int)$this->id))
+            ->execute();
+
+        $this->pageOverlays = [];
+        while ($row = $result->fetch()) {
+            $this->pageOverlays[$row['sys_language_uid']] = $row;
+        };
+
         $this->languageIconTitles = $this->getTranslateTools()->getSystemLanguages($this->id);
     }