[BUGFIX] Use default BE layout if current not available 74/25374/2
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 13 Nov 2013 13:21:39 +0000 (14:21 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Wed, 13 Nov 2013 19:28:25 +0000 (20:28 +0100)
If a specific backend layout is selected in the page properties
and the backend layout is removed later on, the page module is
empty and shows nothing. As a solution the default layout should
be loaded like it is the case if no BE layout is defined at all.

Resolves: #53608
Releases: 6.2
Change-Id: I192833aacc4785a7dfd8e1fb5ed34f12e33d4f5c
Reviewed-on: https://review.typo3.org/25374
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/backend/Classes/View/BackendLayoutView.php

index 9669df6..a1c5e87 100644 (file)
@@ -299,17 +299,20 @@ class BackendLayoutView implements \TYPO3\CMS\Core\SingletonInterface {
                if (isset($this->selectedBackendLayout[$pageId])) {
                        return $this->selectedBackendLayout[$pageId];
                }
-
                $backendLayoutData = NULL;
 
                $selectedCombinedIdentifier = $this->getSelectedCombinedIdentifier($pageId);
-
                // If no backend layout is selected, use default
                if (empty($selectedCombinedIdentifier)) {
                        $selectedCombinedIdentifier = 'default';
                }
 
                $backendLayout = $this->getDataProviderCollection()->getBackendLayout($selectedCombinedIdentifier, $pageId);
+               // If backend layout is not found available anymore, use default
+               if (is_null($backendLayout)) {
+                       $selectedCombinedIdentifier = 'default';
+                       $backendLayout = $this->getDataProviderCollection()->getBackendLayout($selectedCombinedIdentifier, $pageId);
+               }
 
                if (!empty($backendLayout)) {
                        /** @var $parser \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser */