[BUGFIX] Error after hide/show element in list module
authorSimon Schaufelberger <simonschaufi@googlemail.com>
Sat, 8 Oct 2011 14:07:16 +0000 (16:07 +0200)
committerFrancois Suter <francois@typo3.org>
Fri, 4 Nov 2011 08:38:10 +0000 (09:38 +0100)
Showing or hiding an element with workspace selected will result in
Error: Could not be edited in offline workspace...

Change-Id: I43ceaf2443dff7c3d666811726353f3b17b81182
Resolves: #20598
Releases: 4.7, 4.6, 4,5
Reviewed-on: http://review.typo3.org/5633
Reviewed-by: Georg Ringer
Reviewed-by: Simon Schaufelberger
Tested-by: Simon Schaufelberger
Reviewed-by: Francois Suter
Tested-by: Francois Suter
typo3/class.db_list_extra.inc

index 7436836..15f4361 100644 (file)
@@ -1081,6 +1081,11 @@ class localRecordList extends recordList {
        function makeControl($table,$row)       {
                if ($this->dontShowClipControlPanels)   return '';
 
+               $rowUid = $row['uid'];
+               if (t3lib_extMgm::isLoaded('version') && isset($row['_ORIG_uid'])) {
+                       $rowUid = $row['_ORIG_uid'];
+               }
+
                        // Initialize:
                t3lib_div::loadTCA($table);
                $cells=array();
@@ -1229,12 +1234,12 @@ class localRecordList extends recordList {
                                $hiddenField = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'];
                                if ($permsEdit && $hiddenField && $GLOBALS['TCA'][$table]['columns'][$hiddenField] && (!$GLOBALS['TCA'][$table]['columns'][$hiddenField]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $table . ':' . $hiddenField))) {
                                        if ($row[$hiddenField]) {
-                                               $params='&data['.$table.']['.$row['uid'].']['.$hiddenField.']=0';
+                                               $params = '&data[' . $table . '][' . $rowUid . '][' . $hiddenField . ']=0';
                                                $cells['hide']='<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '" title="'.$GLOBALS['LANG']->getLL('unHide' . ($table == 'pages' ? 'Page' : ''), TRUE) . '">' .
                                                                        t3lib_iconWorks::getSpriteIcon('actions-edit-unhide') .
                                                                '</a>';
                                        } else {
-                                               $params='&data['.$table.']['.$row['uid'].']['.$hiddenField.']=1';
+                                               $params = '&data[' . $table . '][' . $rowUid . '][' . $hiddenField . ']=1';
                                                $cells['hide']='<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '" title="' . $GLOBALS['LANG']->getLL('hide' . ($table == 'pages' ? 'Page' : ''), TRUE) . '">' .
                                                                        t3lib_iconWorks::getSpriteIcon('actions-edit-hide') .
                                                                '</a>';