diff -u ../../temp/typo3_src-4.0/t3lib/class.t3lib_befunc.php ./class.t3lib_befunc.php --- ../../temp/typo3_src-4.0/t3lib/class.t3lib_befunc.php 2006-04-07 02:18:29.000000000 +0200 +++ ./typo3_src-4.0/t3lib/class.t3lib_befunc.php 2006-05-24 09:46:04.836816229 +0200 @@ -2801,9 +2801,18 @@ } // ... else the pos/zero pid is just returned here. } else { // No integer pid and we are forced to look up the $pid - $rr = t3lib_BEfunc::getRecord($table,$uid,'pid'); // Try to fetch the record pid from uid. If the uid is 'NEW...' then this will of course return nothing... + $rr = t3lib_BEfunc::getRecord($table,$uid); // Try to fetch the record pid from uid. If the uid is 'NEW...' then this will of course return nothing... if (is_array($rr)) { - $thePidValue = $rr['pid']; // Returning the 'pid' of the record + // first check if the pid is -1 --> it is a record in a draft workspace, + // so get the "real" record + if ($rr['pid'] == '-1') { + $rr = t3lib_BEfunc::getRecord($table,$rr['t3ver_oid'],'pid'); + if (is_array($rr)) { + $thePidValue = $rr['pid']; + } + } else { + $thePidValue = $rr['pid']; // Returning the 'pid' of the record + } } else $thePidValue=-1; // Returns -1 if the record with the pid was not found. } diff -u ../../temp/typo3_src-4.0/t3lib/class.t3lib_tcemain.php ./class.t3lib_tcemain.php --- ../../temp/typo3_src-4.0/t3lib/class.t3lib_tcemain.php 2006-04-07 02:18:29.000000000 +0200 +++ ./typo3_src-4.0/t3lib/class.t3lib_tcemain.php 2006-05-24 09:49:19.351576256 +0200 @@ -3520,6 +3520,14 @@ unlink($lockFileName); } } + + + if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['version_swap'])) { + foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['version_swap'] as $funcName) { + $_params = array('table' => $table, 'orig_id' => $id, 'id' => $swapWith); + t3lib_div::callUserFunction($funcName,$_params,$this); + } + } if (!count($sqlErrors)) {