[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)
committerTolleiv Nietsch <info@tolleiv.de>
Wed, 21 Mar 2012 22:19:05 +0000 (23:19 +0100)
When fetching page-details while using inside a workspace
make sure to fetch the correct overlay.

Change-Id: I7cd58201e4e3babf71e89f2ec7fecfd06f27ad21
Resolves: #27811
Releases: 4.5, 4.6, 4.7, 4.8
Reviewed-on: http://review.typo3.org/3391
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
typo3/sysext/cms/classes/class.tx_cms_backendlayout.php
typo3/sysext/cms/layout/class.tx_cms_layout.php

index 7d26fae..aaa18c7 100644 (file)
@@ -106,10 +106,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 d73f017..35f4e74 100755 (executable)
@@ -305,7 +305,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