Workspace related changes
authorKasper Skårhøj <kasper@typo3.org>
Fri, 4 Nov 2005 17:11:03 +0000 (17:11 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Fri, 4 Nov 2005 17:11:03 +0000 (17:11 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@840 709f56b5-9817-0410-a4d7-c38de5d9e867

TODO.txt
t3lib/class.t3lib_page.php
t3lib/class.t3lib_tcemain.php
t3lib/stddb/tables.php
typo3/sysext/cms/ext_tables.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/impexp/app/index.php
typo3/sysext/impexp/class.tx_impexp.php
typo3/sysext/wizard_crpages/class.tx_wizardcrpages_webfunc_2.php

index 61ec649..bb5ede9 100755 (executable)
--- a/TODO.txt
+++ b/TODO.txt
@@ -303,47 +303,48 @@ SQLengine (t3lib_sqlengine):
 *******************************
 Versioning/Workspaces:
 *******************************
-TESTING by building up sites in multiple workspaces! Running the TemplaVoila wizard in workspace? (or disable it...)
-Finish screenshows for "Inside TYPO3"
+- Running the TemplaVoila wizard in workspace?
+- Dual-view preview?
+- Web > Versioning:
+       - Raising state for all records on a page and using same comment for all + send only one notification email per instance.
+       - "Publish / Swap all" - link
+
+- Documentation:
+       - Finish screenshots for "Inside TYPO3"
+               - Web > View module always showing preview?
+       - TYPO3 Core API:
+               - As frontend preview implementation is dealt with, describe any persisting incompatibilities in "TYPO3 Core API"
+                       - Difficult frontend previews (except for new records which can shadow values)
+                               - All fields selected upon in frontend:
+                                       - $TCA[$table]['ctrl']['languageField'] and $TCA[$table]['ctrl']['transOrigPointerField']
+                                       - field: pages_language_overlay:sys_language_uid
+                                       - field: pages:doktype (used for selection many places!) - but then we cannot make mounts points etc! (?)
+                               - Suggested solution:
+                                       - Setting a workspace-readonly flag for such values!
+                                       - However,
+                                               - menu previews are bypassing the problem already,
+                                               - page shortcut has trouble but is known,
+                                               - mount points will not be possible to preview (?)
+                                               - For new translations we might have the problem, for existing translations probably not since it is unlikely that the fields $TCA[$table]['ctrl']['languageField'] and $TCA[$table]['ctrl']['transOrigPointerField'] are changed later!
 
+----------------------------------
 Frontend Preview:
-- Dual-view preview?
-- ONLINE PREVIEW: Versionized pages should be previewed just by their UID (which will select the offline version!) - only in "Live" space, disabled at the moment inside tslib_fe!
-?!     - TEST: Mounts points and versionized branches? Localization previews?
+- BUG: New pages, setting to hidden are still displayable and shown in menu!
 ?      - tslib_content::getPidList(); TEST Mount points / Use offline UID values for "page" swapmodes; This is probably more natural for preview cases.
 ?      - versionOL() implementations missing:
                - tslib_pibase::pi_getCategoryTableContents()
                - tslib_content::checkPidArray()
                - tslib_content::checkPid()
                - tslib_content::exec_mm_query()/-_uidList() [These seems NOT to be used anymore!]
-- Difficult frontend previews:
-       - All fields selected upon in frontend:
-               - $TCA[$table]['ctrl']['languageField'] and $TCA[$table]['ctrl']['transOrigPointerField']
-               - field: pages_language_overlay:sys_language_uid
-               - field: pages:doktype (used for selection many places!) - but then we cannot make mounts points etc! (?)
-       - Suggested solution:
-               - Setting a workspace-readonly flag for such values!
-               - However,
-                       - menu previews are bypassing the problem already,
-                       - page shortcut has trouble but is known,
-                       - mount points will not be possible to preview (?)
-                       - For new translations we might have the problem, for existing translations probably not since it is unlikely that the fields $TCA[$table]['ctrl']['languageField'] and $TCA[$table]['ctrl']['transOrigPointerField'] are changed later!
-               - For new records, maybe the placeholder record is updated along with offline version? (At least for non-file fields). This would solve the problem of build translations in a workspace and also offer the preview as working!
 - In tslib_fe, this->contentPid is set to "_ORIG_UID" when a versionized page have swapmode set to "0". However this is not completely correct to do: Strictly the "_ORIG_UID" value should be used for tables where "versioning_followPages" is set and for others not. However this is a working quick-fix to display content elements at least!
-       t3lib_page::getPageOverlay() - because pages_language_overlay records have "versioning_followPages" set this should be observed when selecting language overlay records. But should it be hardcoded or something better?
-- Documentation.
-       - As frontend preview implementation is dealt with, describe any persisting incompatibilities in "TYPO3 Core API"
-       - Web > View module always showing preview?
+       - t3lib_page::getPageOverlay() - because pages_language_overlay records have "versioning_followPages" set this should be observed when selecting language overlay records. But should it be hardcoded or something better?
 
-----------------------------------
 Backend preview:
-- Check overlay implementation across core backend:
-       - Permissions / UIDs reflected in buttons and clickmenus.
+- Permissions reflected in buttons and clickmenus.
 - Logging:
        - Finally define logging in tcemain!
        - Filter on workspace
 
-
 TCEmain commands:
 - copy:
        - copying versions:
@@ -355,6 +356,7 @@ TCEmain commands:
        - Copy a page in workspace will not copy the contents?
        - Copy branch in workspace which already has versions - what does it take?
        - Import/Export function?
+       - Web>Page modules copy function for localization
 - localize command
        - ?
 
@@ -369,22 +371,16 @@ Preview modes with no BE login; For single pages, for whole workspace?
 - Respects permissions of backend users issuing that permission!?
 - Dual-view preview?
 
-Workflows:
-- Workflows can regard a whole workspace!
-- Special permission required for:
-       - Publishing workspace / Setting publishing time
-       - Freezing/unfreezing workspace
-
-Documentation:
-- Finish chapter "Using versioning and workspaces" in "Inside TYPO3" with screenshots etc.
-- Documentation "Backend challenges"
-
 Check Various:
 - Auto publishing: Might not work with "Publish only "Publish" stage" because swapped elements will be in editing stage or so!
 
 Workspace Manager TODO:
 - Workspace list
 
+BUGS:
+- In draft workspace: importing a treestructure when "newPagesVersioningType" is set to "1" (new pages as "branch" versions) will only create root point and no subsequent records.
+
+
 -----LATER:
 
 - Branch versioning:
@@ -398,6 +394,7 @@ Workspace Manager TODO:
        - UID references for such as the sys_history and sys_log table are misleading.
        - Branchpoints being swapped will swap their UIDs just like "page" and "element" versions - but in the backend the offline UID of "branch" versions are used heavily. This means references to the branchpoint will be invalid when published.
 
+
 *************************
 Localization workflow:
 *************************
index 27affb3..ee60788 100755 (executable)
@@ -496,7 +496,7 @@ class t3lib_pageSelect {
        function getRootLine($uid, $MP='', $ignoreMPerrors=FALSE)       {
 
                        // Initialize:
-               $selFields = t3lib_div::uniqueList('pid,uid,t3ver_oid,t3ver_wsid,t3ver_state,title,alias,nav_title,media,layout,hidden,starttime,endtime,fe_group,extendToSubpages,doktype,TSconfig,storage_pid,is_siteroot,mount_pid,mount_pid_ol,fe_login_mode,'.$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']);
+               $selFields = t3lib_div::uniqueList('pid,uid,t3ver_oid,t3ver_wsid,t3ver_state,t3ver_swapmode,title,alias,nav_title,media,layout,hidden,starttime,endtime,fe_group,extendToSubpages,doktype,TSconfig,storage_pid,is_siteroot,mount_pid,mount_pid_ol,fe_login_mode,'.$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']);
                $this->error_getRootLine = '';
                $this->error_getRootLine_failPid = 0;
 
@@ -518,7 +518,7 @@ class t3lib_pageSelect {
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($selFields, 'pages', 'uid='.intval($uid).' AND pages.deleted=0 AND pages.doktype!=255');
                        if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                $this->versionOL('pages',$row);
-                               $this->fixVersioningPid('pages',$row,1);
+                               $this->fixVersioningPid('pages',$row);
 
                                if (is_array($row))     {
                                                // Mount Point page types are allowed ONLY a) if they are the outermost record in rootline and b) if the overlay flag is not set:
@@ -541,7 +541,7 @@ class t3lib_pageSelect {
                                                        $mp_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
 
                                                        $this->versionOL('pages',$mp_row);
-                                                       $this->fixVersioningPid('pages',$mp_row,2);
+                                                       $this->fixVersioningPid('pages',$mp_row);
 
                                                        if (is_array($mp_row))  {
                                                                $mount_info = $this->getMountPointInfo($mp_row['uid'], $mp_row);
@@ -767,16 +767,19 @@ class t3lib_pageSelect {
         * @param       string          The table name to search
         * @param       integer         The uid to look up in $table
         * @param       string          The fields to select, default is "*"
+        * @param       boolean         If set, no version overlay is applied
         * @return      mixed           Returns array (the record) if found, otherwise blank/0 (zero)
         * @see getPage_noCheck()
         */
-       function getRawRecord($table,$uid,$fields='*')  {
+       function getRawRecord($table,$uid,$fields='*',$noWSOL=FALSE)    {
                global $TCA;
                $uid = intval($uid);
                if (is_array($TCA[$table]) || $table=='pages') {        // Excluding pages here so we can ask the function BEFORE TCA gets initialized. Support for this is followed up in deleteClause()...
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, 'uid='.intval($uid).$this->deleteClause($table));
                        if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                               $this->versionOL($table,$row);
+                               if (!$noWSOL)   {
+                                       $this->versionOL($table,$row);
+                               }
                                if (is_array($row))     return $row;
                        }
                }
@@ -1034,7 +1037,7 @@ class t3lib_pageSelect {
                                $oid = $rr['t3ver_oid'];
                                $wsid = $rr['t3ver_wsid'];
                        } else {        // Otherwise we have to expect "uid" to be in the record and look up based on this:
-                               $newPidRec = $this->getRawRecord($table,$rr['uid'],'t3ver_oid,t3ver_wsid');
+                               $newPidRec = $this->getRawRecord($table,$rr['uid'],'t3ver_oid,t3ver_wsid',TRUE);
                                if (is_array($newPidRec))       {
                                        $oid = $newPidRec['t3ver_oid'];
                                        $wsid = $newPidRec['t3ver_wsid'];
@@ -1043,7 +1046,8 @@ class t3lib_pageSelect {
 
                                // If workspace ids matches and ID of current online version is found, look up the PID value of that:
                        if ($oid && !strcmp((int)$wsid,$this->versioningWorkspaceId))   {
-                               $oidRec = $this->getRawRecord($table,$oid,'pid');
+                               $oidRec = $this->getRawRecord($table,$oid,'pid',TRUE);
+
                                if (is_array($oidRec))  {
                                        # SWAP uid as well? Well no, because when fixing a versioning PID happens it is assumed that this is a "branch" type page and therefore the uid should be kept (like in versionOL()). However if the page is NOT a branch version it should not happen - but then again, direct access to that uid should not happen!
                                        $rr['_ORIG_pid'] = $rr['pid'];
index fb9390c..5182963 100755 (executable)
@@ -861,6 +861,7 @@ class t3lib_TCEmain {
 
                                $lookUpTable = $TCA[$table]['ctrl']['transOrigPointerTable'] ? $TCA[$table]['ctrl']['transOrigPointerTable'] : $table;
                                $originalLanguageRecord = $this->recordInfo($lookUpTable,$currentRecord[$TCA[$table]['ctrl']['transOrigPointerField']],'*');
+                               t3lib_BEfunc::workspaceOL($lookUpTable,$originalLanguageRecord);
                                $originalLanguage_diffStorage = unserialize($currentRecord[$TCA[$table]['ctrl']['transOrigDiffSourceField']]);
                        }
                }
@@ -2192,7 +2193,8 @@ class t3lib_TCEmain       {
 
                                $nonFields = array_unique(t3lib_div::trimExplode(',','uid,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,t3ver_oid,t3ver_wsid,t3ver_id,t3ver_label,t3ver_state,t3ver_swapmode,t3ver_count,t3ver_stage,t3ver_tstamp,'.$excludeFields,1));
 
-                               $row = $this->recordInfo($table,$uid,'*');
+                               #$row = $this->recordInfo($table,$uid,'*');
+                               $row = t3lib_BEfunc::getRecordWSOL($table,$uid);        // So it copies (and localized) content from workspace...
                                if (is_array($row))     {
 
                                                // Initializing:
@@ -2688,18 +2690,19 @@ class t3lib_TCEmain     {
                        $origDestPid = $destPid;
 
                        $propArr = $this->getRecordProperties($table,$uid);     // Get this before we change the pid (for logging)
+                       $moveRec = $this->getRecordProperties($table,$uid,TRUE);
                        $resolvedPid = $this->resolvePid($table,$destPid);      // This is the actual pid of the moving to destination
 
                                // Finding out, if the record may be moved from where it is. If the record is a non-page, then it depends on edit-permissions.
                                // If the record is a page, then there are two options: If the page is moved within itself, (same pid) it's edit-perms of the pid. If moved to another place then its both delete-perms of the pid and new-page perms on the destination.
-                       if ($table!='pages' || $resolvedPid==$propArr['pid'])   {
+                       if ($table!='pages' || $resolvedPid==$moveRec['pid'])   {
                                $mayMoveAccess = $this->checkRecordUpdateAccess($table,$uid);   // Edit rights for the record...
                        } else {
                                $mayMoveAccess = $this->doesRecordExist($table,$uid,'delete');
                        }
 
                                // Finding out, if the record may be moved TO another place. Here we check insert-rights (non-pages = edit, pages = new), unless the pages are moved on the same pid, then edit-rights are checked
-                       if ($table!='pages' || $resolvedPid!=$propArr['pid'])   {
+                       if ($table!='pages' || $resolvedPid!=$moveRec['pid'])   {
                                $mayInsertAccess = $this->checkRecordInsertAccess($table,$resolvedPid,4);       // Insert rights for the record...
                        } else {
                                $mayInsertAccess = $this->checkRecordUpdateAccess($table,$uid);
@@ -2707,14 +2710,14 @@ class t3lib_TCEmain     {
 
                                // Check workspace permissions:
                        $workspaceAccessBlocked = array();
-                       $recIsNewVersion = !strcmp($propArr['_ORIG_pid'],'') && (int)$propArr['t3ver_state']==1;        // Element was an online version AND it was in "New state" so it can be moved...
+                       $recIsNewVersion = !strcmp($moveRec['_ORIG_pid'],'') && (int)$moveRec['t3ver_state']==1;        // Element was an online version AND it was in "New state" so it can be moved...
                        $destRes = $this->BE_USER->workspaceAllowLiveRecordsInPID($resolvedPid,$table);
                                // Workspace source check:
                        if ($errorCode = $this->BE_USER->workspaceCannotEditRecord($table, $WSversion['uid'] ? $WSversion['uid'] : $uid))       {
                                $workspaceAccessBlocked['src1']='Record could not be edited in workspace: '.$errorCode.' ';
                        } else {
-                               if (!$recIsNewVersion && $this->BE_USER->workspaceAllowLiveRecordsInPID($propArr['pid'],$table)<=0)     {
-                                       $workspaceAccessBlocked['src2']='Could not remove record from table "'.$table.'" from its page "'.$propArr['pid'].'" ';
+                               if (!$recIsNewVersion && $this->BE_USER->workspaceAllowLiveRecordsInPID($moveRec['pid'],$table)<=0)     {
+                                       $workspaceAccessBlocked['src2']='Could not remove record from table "'.$table.'" from its page "'.$moveRec['pid'].'" ';
                                }
                        }
                                // Workspace destination check:
@@ -2845,7 +2848,7 @@ class t3lib_TCEmain       {
                                if ($langRec = t3lib_BEfunc::getRecord('sys_language',intval($language),'uid,title'))   {
                                        if ($this->doesRecordExist($table,$uid,'show')) {
 
-                                               $row = $this->recordInfo($table,$uid,'*');
+                                               $row = t3lib_BEfunc::getRecordWSOL($table,$uid);        // Getting workspace overlay if possible - this will localize versions in workspace if any
                                                if (is_array($row))     {
                                                        if ($row[$TCA[$table]['ctrl']['languageField']] <= 0)   {
                                                                if ($row[$TCA[$table]['ctrl']['transOrigPointerField']] == 0)   {
@@ -3389,10 +3392,6 @@ class t3lib_TCEmain      {
                                                                                if ($swapVersion['t3ver_state']==2)     {
                                                                                        $this->deleteEl($table,$id,TRUE);       // Force delete
                                                                                }
-                                                                                       // Checking for "new-placeholder" and if found, delete it:
-                                                                               if ($curVersion['t3ver_state']==1)      {
-                                                                                       $this->deleteEl($table, $swapWith, TRUE, TRUE);         // For delete + completely delete!
-                                                                               }
 
                                                                                if (!count($sqlErrors)) {
                                                                                        $this->newlog('Swapping successful for table "'.$table.'" uid '.$id.'=>'.$swapWith);
@@ -3403,7 +3402,6 @@ class t3lib_TCEmain       {
                                                                                                        // Collect table names that should be copied along with the tables:
                                                                                                foreach($TCA as $tN => $tCfg)   {
                                                                                                        if ($swapVersion['t3ver_swapmode']>0 || $TCA[$tN]['ctrl']['versioning_followPages'])    {       // For "Branch" publishing swap ALL, otherwise for "page" publishing, swap only "versioning_followPages" tables
-                               #debug($tN,'SWAPPING pids for subrecords:');
                                                                                                                $temporaryPid = -($id+1000000);
 
                                                                                                                $GLOBALS['TYPO3_DB']->exec_UPDATEquery($tN,'pid='.intval($id),array('pid'=>$temporaryPid));
@@ -3425,6 +3423,12 @@ class t3lib_TCEmain      {
                                                                                        $this->clear_cache($table,$id);
 
                                                                                } else $this->newlog('During Swapping: SQL errors happend: '.implode('; ',$sqlErrors),2);
+
+                                                                                       // Checking for "new-placeholder" and if found, delete it (BUT FIRST after swapping!):
+                                                                               if ($curVersion['t3ver_state']==1)      {
+                                                                                       $this->deleteEl($table, $swapWith, TRUE, TRUE);         // For delete + completely delete!
+                                                                               }
+
                                                                        } else $this->newlog('In swap version, either pid was not -1 or the t3ver_oid didn\'t match the id of the online version as it must!',2);
                                                                } else $this->newlog('Error: A record with a negative UID existed - that indicates some inconsistency in the database from prior versioning actions!',2);
                                                        } else $this->newlog('Workspace #'.$swapVersion['t3ver_wsid'].' does not support swapping.',1);
@@ -4104,14 +4108,18 @@ $this->log($table,$id,6,0,0,'Stage raised...',-1,array('comment'=>$comment,'stag
         * Returns an array with record properties, like header and pid
         * No check for deleted or access is done!
         * For versionized records, pid is resolved to its live versions pid.
+        * Used for loggin
         *
         * @param       string          Table name
         * @param       integer         Uid
+        * @param       boolean         If set, no workspace overlay is performed
         * @return      array           Properties of record
         */
-       function getRecordProperties($table,$id)        {
+       function getRecordProperties($table,$id,$noWSOL=FALSE)  {
                $row = ($table=='pages' && !$id) ? array('title'=>'[root-level]', 'uid' => 0, 'pid' => 0) :$this->recordInfo($table,$id,'*');
-               t3lib_BEfunc::workspaceOL($table,$row);
+               if (!$noWSOL)   {
+                       t3lib_BEfunc::workspaceOL($table,$row);
+               }
                t3lib_BEfunc::fixVersioningPid($table,$row);
                return $this->getRecordPropertiesFromRow($table,$row);
        }
index 4109c5c..b1018d7 100755 (executable)
@@ -148,7 +148,8 @@ $TCA['pages'] = Array (
                'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
                'cruser_id' => 'cruser_id',
                'editlock' => 'editlock',
-               'useColumnsForDefaultValues' => 'doktype'
+               'useColumnsForDefaultValues' => 'doktype',
+               'shadowColumnsForNewPlaceholders' => 'doktype,title',
        ),
        'interface' => Array (
                'showRecordFieldList' => 'doktype,title',
index d96bcb1..ea62c02 100755 (executable)
@@ -511,7 +511,7 @@ $TCA['tt_content'] = Array (
                'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
                'copyAfterDuplFields' => 'colPos,sys_language_uid',
                'useColumnsForDefaultValues' => 'colPos,sys_language_uid',
-               'shadowColumnsForNewPlaceholders' => 'sys_language_uid,l18n_parent,colPos',
+               'shadowColumnsForNewPlaceholders' => 'sys_language_uid,l18n_parent,colPos,header',
                'transOrigPointerField' => 'l18n_parent',
                'transOrigDiffSourceField' => 'l18n_diffsource',
                'languageField' => 'sys_language_uid',
@@ -630,7 +630,7 @@ $TCA['pages_language_overlay'] = Array (
                'transOrigPointerField' => 'pid',
                'transOrigPointerTable' => 'pages',
                'transOrigDiffSourceField' => 'l18n_diffsource',
-               'shadowColumnsForNewPlaceholders' => 'sys_language_uid',
+               'shadowColumnsForNewPlaceholders' => 'sys_language_uid,title',
                'languageField' => 'sys_language_uid',
                'mainpalette' => 1,
                'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tbl_cms.php'
index f21f631..401fff7 100755 (executable)
                                        $this->showHiddenPage = 1;
                                }
 
-                                       // Check root line for proper connection to tree root (done because of possible preview of page / branch versions) [This will be done when in online workspace...]
-/*
-TEMPORARILY disabled version previews in online workspace (while testing offline workspaces)
-                               if (!$this->fePreview)  {
+                                       // For Live workspace: Check root line for proper connection to tree root (done because of possible preview of page / branch versions)
+                               if (!$this->fePreview && $GLOBALS['BE_USER']->workspace==0)     {
 
                                                // Initialize the page-select functions to check rootline:
                                        $temp_sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
@@ -725,11 +723,9 @@ TEMPORARILY disabled version previews in online workspace (while testing offline
                                                if (count($temp_sys_page->getRootLine($this->id,$this->MP)))    {
                                                                // Finally, we got a root line (meaning that it WAS due to versioning preview of a page somewhere) and we set the fePreview flag which in itself will allow sys_page class to display previews of versionized records.
                                                        $this->fePreview = 1;
-#debug('version in rootline...');
                                                }
                                        }
                                }
-*/
                        }
 
                                // The preview flag will be set if a backend user is in an offline workspace
index e622d8a..7f73652 100755 (executable)
@@ -227,7 +227,7 @@ class localPageTree extends t3lib_browseTree {
                $firstHtml = $this->PM_ATagWrap($icon,$cmd);
 
                if ($pid>0)     {
-                       $rootRec = t3lib_befunc::getRecord('pages',$pid);
+                       $rootRec = t3lib_befunc::getRecordWSOL('pages',$pid);
                        $firstHtml.= $this->wrapIcon(t3lib_iconWorks::getIconImage('pages',$rootRec,$this->backPath,'align="top"'),$rootRec);
                } else {
                        $rootRec = array(
@@ -494,7 +494,7 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
                                                'title' => 'ROOT'
                                        );
                                } else {
-                                       $sPage = t3lib_BEfunc::getRecord('pages',$inData['pagetree']['id'],'*',' AND '.$this->perms_clause);
+                                       $sPage = t3lib_BEfunc::getRecordWSOL('pages',$inData['pagetree']['id'],'*',' AND '.$this->perms_clause);
                                }
                                if (is_array($sPage))   {
                                        $pid = $inData['pagetree']['id'];
@@ -779,7 +779,7 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
                                $tName = $rParts[0];
                                $rUid = $rParts[1];
                                $nameSuggestion.= $tName.'_'.$rUid;
-                               $rec = t3lib_BEfunc::getRecord($tName,$rUid);
+                               $rec = t3lib_BEfunc::getRecordWSOL($tName,$rUid);
 
                                $row[] = '
                                <tr class="bgColor4">
@@ -804,7 +804,7 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
                                $tName = $rParts[0];
 
                                if ($GLOBALS['BE_USER']->check('tables_select',$tName)) {
-                                       $rec = t3lib_BEfunc::getRecord('pages', $rParts[1]);
+                                       $rec = t3lib_BEfunc::getRecordWSOL('pages', $rParts[1]);
                                        $tblList.='Table "'.$tName.'" from '.t3lib_iconworks::getIconImage('pages',$rec,$GLOBALS['BACK_PATH'],' align="top"').
                                        t3lib_BEfunc::getRecordTitle('pages',$rec,1).
                                        '<input type="hidden" name="tx_impexp[list][]" value="'.htmlspecialchars($ref).'" /><br/>';
index 5652c3b..3952741 100755 (executable)
@@ -488,6 +488,9 @@ class tx_impexp {
         * @return      void
         */
        function export_addRecord($table,$row,$relationLevel=0) {
+
+               t3lib_BEfunc::workspaceOL($table,$row);
+
                if (strcmp($table,'') && is_array($row) && $row['uid']>0 && !$this->excludeMap[$table.':'.$row['uid']]) {
                        if ($this->checkPID($table==='pages' ? $row['uid'] : $row['pid']))      {
                                if (!isset($this->dat['records'][$table.':'.$row['uid']]))      {
@@ -1775,6 +1778,12 @@ class tx_impexp {
                                // If the record has been written and received a new id, then proceed:
                        if (is_array($this->import_mapId[$table]) && isset($this->import_mapId[$table][$uid]))  {
                                $thisNewUid = $this->import_mapId[$table][$uid];
+
+                                       // If the new versions are made in a workspace we must further remap the uids:
+                               if ($newVersionRec = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, $table, $thisNewUid, 'uid'))     {
+                                       $thisNewUid = $newVersionRec['uid'];
+                               }
+
                                if (is_array($this->dat['records'][$table.':'.$uid]['rels']))   {
                                        reset($this->dat['records'][$table.':'.$uid]['rels']);
 
@@ -2886,6 +2895,7 @@ class tx_impexp {
                                        if ($newUid = $this->import_mapId[$table][$uid])        {
                                                $diffInverse = FALSE;
                                                $recInf = $this->doesRecordExist($table, $newUid, '*');
+                                               t3lib_BEfunc::workspaceOL($table,$recInf);
                                        }
                                        if (is_array($recInf))  {
                                                $pInfo['showDiffContent'] = $this->compareRecords($recInf, $this->dat['records'][$table.':'.$uid]['data'], $table, $diffInverse);
index 530b782..842b0d8 100755 (executable)
@@ -137,6 +137,7 @@ class tx_wizardcrpages_webfunc_2 extends t3lib_extobjbase {
                                reset($menuItems);
                                $lines=array();
                                while(list(,$rec)=each($menuItems))     {
+                                       t3lib_BEfunc::workspaceOL('pages',$rec);
                                        $lines[]= '<nobr>'.t3lib_iconWorks::getIconImage('pages',$rec,$GLOBALS['BACK_PATH'],'align="top" '.t3lib_BEfunc::titleAttribForPages($rec)).
                                                htmlspecialchars(t3lib_div::fixed_lgd_cs($rec['title'],$GLOBALS['BE_USER']->uc['titleLen'])).'</nobr>';
                                }