[BUGFIX] Error after hide/show element in list module
authorSimon Schaufelberger <simonschaufi@googlemail.com>
Wed, 16 Nov 2011 18:22:36 +0000 (12:22 -0600)
committerFrancois Suter <francois@typo3.org>
Fri, 18 Nov 2011 20:21:50 +0000 (21:21 +0100)
Showing or hiding an element with workspace selected will result in
Error: Could not be edited in offline workspace...

Change-Id: I768320084fd24917d22cbc1d01b47387da863605
Resolves: #20598
Releases: 4.7, 4.6, 4,5
Reviewed-on: http://review.typo3.org/6703
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 35065de..07a836e 100644 (file)
@@ -1135,6 +1135,11 @@ class localRecordList extends recordList {
 
                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();
@@ -1269,12 +1274,12 @@ class localRecordList extends recordList {
                                $hiddenField = $TCA[$table]['ctrl']['enablecolumns']['disabled'];
                                if ($permsEdit && $hiddenField && $TCA[$table]['columns'][$hiddenField] && (!$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(\''.$SOBE->doc->issueCommand($params,-1).'\');').'" title="'.$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(\''.$SOBE->doc->issueCommand($params,-1).'\');').'" title="'.$LANG->getLL('hide' . ($table == 'pages' ? 'Page' : ''), TRUE) . '">' .
                                                                        t3lib_iconWorks::getSpriteIcon('actions-edit-hide') .
                                                                '</a>';