[TASK] Show only pages_language_overlay records with a defined language 33/52133/3
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 23 Mar 2017 11:59:49 +0000 (12:59 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 23 Mar 2017 13:27:07 +0000 (14:27 +0100)
The list module must not use any pages_language_overlay records with
a sys_language_uid=0. First this doesn't make sense and furthermore
this has ugly side effects like an empty localize button.

Resolves: #80402
Releases: master
Change-Id: I97155ab66b2185d681e833a67448d3e565c7f521
Reviewed-on: https://review.typo3.org/52133
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/RecordList/AbstractRecordList.php

index efcf03c..e4cc6c6 100644 (file)
@@ -435,7 +435,12 @@ abstract class AbstractRecordList
         $result = $queryBuilder
             ->select('*')
             ->from('pages_language_overlay')
-            ->where($queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT)))
+            ->where(
+                $queryBuilder->expr()->andX(
+                    $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT)),
+                    $queryBuilder->expr()->gt('sys_language_uid', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
+                )
+            )
             ->execute();
 
         $this->pageOverlays = [];