[BUGFIX] Correct handling of empty Backend Layouts 82/24882/5
authorAlexander Stehlik <alexander.stehlik@googlemail.com>
Mon, 21 Oct 2013 06:49:42 +0000 (08:49 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 15 Jan 2014 04:59:13 +0000 (05:59 +0100)
Since the default value of the page properties backend_layout and
backend_layout_next_level is an empty string the value in the select
item is changed from zero to an empty string for consistency.

Additionally the BackendLayoutView will treat an empty string equally
as a zero namely as a non set Backend Layout.

Resolves: #52596
Releases: 6.2
Change-Id: Ic792f748d005f5749f24a3e979b304c23320c8fa
Reviewed-on: https://review.typo3.org/24882
Reviewed-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/backend/Classes/View/BackendLayoutView.php
typo3/sysext/core/Configuration/TCA/pages.php
typo3/sysext/core/ext_tables.sql

index a1e8adc..9a9a49e 100644 (file)
@@ -188,7 +188,7 @@ class BackendLayoutView implements \TYPO3\CMS\Core\SingletonInterface {
                        if ($this->selectedCombinedIdentifier[$pageId] === '-1') {
                                // If it is set to "none" - don't use any
                                $this->selectedCombinedIdentifier[$pageId] = FALSE;
-                       } elseif ($this->selectedCombinedIdentifier[$pageId] === '0') {
+                       } elseif ($this->selectedCombinedIdentifier[$pageId] === '' || $this->selectedCombinedIdentifier[$pageId] === '0') {
                                // If it not set check the root-line for a layout on next level and use this
                                // (root-line starts with current page and has page "0" at the end)
                                $rootLine = $this->getRootLine($pageId);
@@ -201,7 +201,7 @@ class BackendLayoutView implements \TYPO3\CMS\Core\SingletonInterface {
                                                // If layout for "next level" is set to "none" - don't use any and stop searching
                                                $this->selectedCombinedIdentifier[$pageId] = FALSE;
                                                break;
-                                       } elseif ($this->selectedCombinedIdentifier[$pageId] !== '0') {
+                                       } elseif ($this->selectedCombinedIdentifier[$pageId] !== '' && $this->selectedCombinedIdentifier[$pageId] !== '0') {
                                                // Stop searching if a layout for "next level" is set
                                                break;
                                        }
index 896e266..e2ab8cd 100644 (file)
@@ -760,7 +760,7 @@ return array(
                        'config' => array(
                                'type' => 'select',
                                'items' => array(
-                                       array('', 0),
+                                       array('', ''),
                                        array('LLL:EXT:cms/locallang_tca.xlf:pages.backend_layout.none', -1)
                                ),
                                'itemsProcFunc' => 'TYPO3\\CMS\\Backend\\View\\BackendLayoutView->addBackendLayoutItems',
@@ -775,7 +775,7 @@ return array(
                        'config' => array(
                                'type' => 'select',
                                'items' => array(
-                                       array('', 0),
+                                       array('', ''),
                                        array('LLL:EXT:cms/locallang_tca.xlf:pages.backend_layout.none', -1)
                                ),
                                'itemsProcFunc' => 'TYPO3\\CMS\\Backend\\View\\BackendLayoutView->addBackendLayoutItems',
index 615d647..0fa32f7 100644 (file)
@@ -175,8 +175,8 @@ CREATE TABLE pages (
   alias varchar(32) DEFAULT '' NOT NULL,
   l18n_cfg tinyint(4) DEFAULT '0' NOT NULL,
   fe_login_mode tinyint(4) DEFAULT '0' NOT NULL,
-  backend_layout varchar(64) DEFAULT '0' NOT NULL,
-  backend_layout_next_level varchar(64) DEFAULT '0' NOT NULL,
+  backend_layout varchar(64) DEFAULT '' NOT NULL,
+  backend_layout_next_level varchar(64) DEFAULT '' NOT NULL,
   PRIMARY KEY (uid),
   KEY t3ver_oid (t3ver_oid,t3ver_wsid),
   KEY parent (pid,deleted,sorting),