[BUGFIX] Web->Page - Language view not usable 98/21498/3
authorStefan Galinski <stefan.galinski@gmail.com>
Tue, 18 Jun 2013 15:26:50 +0000 (17:26 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Thu, 4 Jul 2013 18:27:38 +0000 (20:27 +0200)
Since the "all language" elements are displayed in each
language (introduced in 4.7), the language view of the
page module is not really usable anymore. If you have
activated the mod.web_layout.defLangBinding setting in the
Page TS configuration  "all language" elements are not
displayed anymore. Also you cannot overwrite "all language"
elements in an easy way inside another languages
and overwritten elements are displayed together with their
"all language" default element inside a column. Furthermore
the sorting order is sometimes broken on non-default languages
if the "all language" element is rendered inside the column.
The patch fixes all this issues in the languages view by
reverting the changes introduced the 4.7 branch just for the
languages view. The columns view works like it was intented with
the fix from the 4.7 branch (it still has the same flaws as
the languages view, but this issues can be fixed with another
changeset).

Fixes: #42768
Fixes: #42771
Releases: 6.2, 6.1, 6.0
Change-Id: Ibd222c3980ebcc7a5f273d85b3d99d6938291e9e
Reviewed-on: https://review.typo3.org/21498
Reviewed-by: Ingo Pfennigstorf
Tested-by: Ingo Pfennigstorf
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/backend/Classes/View/PageLayoutView.php

index 6eba857..9b45ac0 100644 (file)
@@ -420,7 +420,11 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                        // For each languages... :
                        // If not languageMode, then we'll only be through this once.
                        foreach ($langListArr as $lP) {
-                               $showLanguage = ' AND sys_language_uid IN (' . intval($lP) . ',-1)';
+                               if (count($langListArr) === 1 || $lP == 0) {
+                                       $showLanguage = ' AND sys_language_uid IN (' . intval($lP) . ',-1)';
+                               } else {
+                                       $showLanguage = ' AND sys_language_uid=' . $lP;
+                               }
                                $cList = explode(',', $this->tt_contentConfig['cols']);
                                $content = array();
                                $head = array();
@@ -455,7 +459,9 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                                }
                                                if (is_array($row) && (int) $row['t3ver_state'] != 2) {
                                                        $singleElementHTML = '';
-                                                       if (!$lP && $row['sys_language_uid'] != -1) {
+                                                       if (($this->defLangBinding && !$lP) ||
+                                                               (!$this->defLangBinding && $lP && $row['sys_language_uid'] != -1)
+                                                       ) {
                                                                $defLanguageCount[$key][] = $row['uid'];
                                                        }
                                                        $editUidList .= $row['uid'] . ',';
@@ -1969,4 +1975,4 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
 
 }
 
-?>
\ No newline at end of file
+?>