[BUGFIX] Use context specific table in PageRepository 31/50231/4
authorOliver Hader <oliver@typo3.org>
Fri, 14 Oct 2016 18:43:38 +0000 (20:43 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Fri, 14 Oct 2016 22:07:53 +0000 (00:07 +0200)
By invoking the ConnectionPool instance, it's possible to use
different database connections and different database platforms
for a particular table. If for instance the system is running on
MySQL in general, but one single table (not pages) uses SQLite,
PageRepository::enableFields() is using quoting characters for
MySQL in the SQLite context - which fails.

Resolves: #78301
Releases: master
Change-Id: I8317a22126b1725a1730ebc66042dbdbfc18fd7c
Reviewed-on: https://review.typo3.org/50231
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/frontend/Classes/Page/PageRepository.php

index c5fee05..1f3821c 100644 (file)
@@ -1316,7 +1316,7 @@ class PageRepository
         // If show_hidden was not changed during the previous evaluation, do it here.
         $ctrl = $GLOBALS['TCA'][$table]['ctrl'];
         $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getQueryBuilderForTable('pages')
+            ->getQueryBuilderForTable($table)
             ->expr();
         $constraints = [];
         if (is_array($ctrl)) {