[TASK] Revert "[BUGFIX] Honor l18n_cfg settings in PageRepository" 77/57277/3
authorNicole Cordes <typo3@cordes.co>
Thu, 21 Jun 2018 08:43:31 +0000 (10:43 +0200)
committerNicole Cordes <typo3@cordes.co>
Fri, 22 Jun 2018 14:02:47 +0000 (16:02 +0200)
This reverts commit 7e8a72cfde06597eca5c4d30ecbdb6b3ab7a541d.

Handling l18n_cfg in PageRespository is the wrong place and breaks
current core behaviour. The problem needs to be resolved somewhere else.

Reverts: #85063
Resolves: #85339
Releases: master
Change-Id: Ic61c64be8769ba85208efa7635dcb1f1cbaa2f08
Reviewed-on: https://review.typo3.org/57277
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Tests/Functional/Fixtures/pages.xml
typo3/sysext/frontend/Tests/Functional/Page/PageRepositoryTest.php

index 2a62d44..5c82755 100644 (file)
@@ -235,7 +235,7 @@ class PageRepository implements LoggerAwareInterface
      * The page record is either served from a first-level cache or loaded from the
      * database. If no page can be found, an empty array is returned.
      *
-     * Language overlay and version overlay are applied. Mount Point
+     * Language overlay and versioning overlay are applied. Mount Point
      * handling is not done, an overlaid Mount Point is not replaced.
      *
      * The result is conditioned by the public properties where_groupAccess
@@ -297,16 +297,9 @@ class PageRepository implements LoggerAwareInterface
 
         $row = $queryBuilder->execute()->fetch();
         if ($row) {
-            $tsfe = $this->getTypoScriptFrontendController();
-            if ($tsfe->sys_language_uid > 0 || !GeneralUtility::hideIfDefaultLanguage($row['l18n_cfg'])) {
-                $this->versionOL('pages', $row);
-                if (is_array($row)) {
-                    $row = $this->getPageOverlay($row);
-
-                    if ($tsfe->sys_language_uid === 0 || isset($row['_PAGES_OVERLAY']) || !GeneralUtility::hideIfNotTranslated($row['l18n_cfg'])) {
-                        $result = $row;
-                    }
-                }
+            $this->versionOL('pages', $row);
+            if (is_array($row)) {
+                $result = $this->getPageOverlay($row);
             }
         }
         $this->cache_getPage[$uid][$cacheKey] = $result;
@@ -734,10 +727,6 @@ class PageRepository implements LoggerAwareInterface
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages');
         $queryBuilder->getRestrictions()->removeAll();
 
-        // Always ensure fetching l18n_cfg for further processing
-        if ($fields !== '*' && !GeneralUtility::inList($fields, 'l18n_cfg')) {
-            $fields .= ',l18n_cfg';
-        }
         $res = $queryBuilder->select(...GeneralUtility::trimExplode(',', $fields, true))
             ->from('pages')
             ->where(
@@ -768,9 +757,9 @@ class PageRepository implements LoggerAwareInterface
 
             // Versioning Preview Overlay
             $this->versionOL('pages', $page, true);
-            // Skip if page got disabled due to version overlay or default language should be hidden
-            // (might be deleted or move placeholder)
-            if (empty($page) || GeneralUtility::hideIfDefaultLanguage($page['l18n_cfg'])) {
+            // Skip if page got disabled due to version overlay
+            // (might be delete or move placeholder)
+            if (empty($page)) {
                 continue;
             }
 
index 40e7612..abb60ee 100644 (file)
     </pages>
 
     <pages>
-        <uid>501</uid>
-        <pid>1</pid>
-        <title>Localization 1-501</title>
-        <deleted>0</deleted>
-        <l18n_cfg>1</l18n_cfg>
-    </pages>
-    <pages>
-        <uid>502</uid>
-        <pid>1</pid>
-        <title>√úbersetzung 1-501</title>
-        <deleted>0</deleted>
-        <l10n_parent>501</l10n_parent>
-        <l18n_cfg>1</l18n_cfg>
-        <sys_language_uid>1</sys_language_uid>
-    </pages>
-
-    <pages>
         <uid>901</uid>
         <pid>0</pid>
         <l10n_parent>1</l10n_parent>
index c99603a..b24b527 100644 (file)
@@ -98,15 +98,6 @@ class PageRepositoryTest extends \TYPO3\TestingFramework\Core\Functional\Functio
     /**
      * @test
      */
-    public function getPageReturnsEmptyArrayWithHideIfDefaultLanguage()
-    {
-        $row = $this->pageRepo->getPage(501);
-        $this->assertSame([], $row);
-    }
-
-    /**
-     * @test
-     */
     public function getPageOverlayById()
     {
         $row = $this->pageRepo->getPageOverlay(1, 1);