[BUGFIX] Backend: Fetch correct overlay-version of page inside workspace
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 26 Feb 2012 23:01:29 +0000 (00:01 +0100)
committerThorsten Kahler <thorsten.kahler@typo3.org>
Thu, 19 Apr 2012 08:09:44 +0000 (10:09 +0200)
When fetching page-details while using inside a workspace
make sure to fetch the correct overlay.

Change-Id: I4a9b98550a1ca7d032f6bb4382f6e06ae70a9564
Resolves: #27811
Releases: 4.5, 4.6, 4.7, 4.8
Reviewed-on: http://review.typo3.org/9792
Reviewed-by: Stefan Neufeind
Reviewed-by: Timo Webler
Tested-by: Timo Webler
Reviewed-by: Thorsten Kahler
Tested-by: Thorsten Kahler
typo3/sysext/cms/classes/class.tx_cms_backendlayout.php
typo3/sysext/cms/layout/class.tx_cms_layout.php

index 585bc7b..4804633 100644 (file)
@@ -105,10 +105,13 @@ class tx_cms_BackendLayout {
 
                for ($i = count($rootline); $i > 0; $i--) {
                        $page = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
-                               'uid, backend_layout, backend_layout_next_level',
+                                       // pid and t3ver_swapmode needed here for workspaceOL()
+                               'uid, pid, t3ver_swapmode, backend_layout, backend_layout_next_level',
                                'pages',
                                'uid=' . intval($rootline[$i]['uid'])
                        );
+                       t3lib_BEfunc::workspaceOL('pages', $page);
+
                        $selectedBackendLayout = intval($page['backend_layout']);
                        $selectedBackendLayoutNextLevel = intval($page['backend_layout_next_level']);
                        if ($selectedBackendLayout != 0 && $page['uid'] == $id) {
index 67c0ab0..b4fd278 100755 (executable)
@@ -398,7 +398,10 @@ class tx_cms_layout extends recordList {
         * @return mixed Uid of the backend layout record or NULL if no layout should be used
         */
        function getSelectedBackendLayoutUid($id) {
-               $page = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('backend_layout', 'pages', 'uid=' . $id);
+                       // uid, pid, t3ver_swapmode needed for workspaceOL()
+               $page = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid, pid, t3ver_swapmode, backend_layout', 'pages', 'uid=' . $id);
+               t3lib_BEfunc::workspaceOL('pages', $page);
+
                $backendLayoutUid = intval($page['backend_layout']);
                if ($backendLayoutUid == -1) {
                                // if it is set to "none" - don't use any