--- class.t3lib_tcemain.php +++ class.t3lib_tcemain.php @@ -4453,7 +4453,7 @@ * @return void */ function version_swap($table,$id,$swapWith,$swapIntoWS=0) { - global $TCA; + global $TCA, $TYPO3_CONF_VARS;; // First, check if we may actually edit the online record if ($this->checkRecordUpdateAccess($table,$id)) { @@ -4473,6 +4473,14 @@ // Check if the swapWith record really IS a version of the original! if ((int)$swapVersion['pid']==-1 && (int)$curVersion['pid']>=0 && !strcmp($swapVersion['t3ver_oid'],$id)) { + + // First prepare user defined objects (if any) for hooks which extend this function: + $hookObjectsArr = array(); + if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processVersionSwapClass'])) { + foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processVersionSwapClass'] as $classRef) { + $hookObjectsArr[] = &t3lib_div::getUserObj($classRef); + } + } // Lock file name: $lockFileName = PATH_site.'typo3temp/swap_locking/'.$table.':'.$id.'.ser'; @@ -4571,7 +4579,14 @@ unlink($lockFileName); } } - + + // Hook: processSwap_postProcessSwap + foreach($hookObjectsArr as $hookObj) { + if (method_exists($hookObj, 'processSwap_postProcessSwap')) { + $hookObj->processSwap_postProcessSwap($table, $id, $swapWith, $swapIntoWS, $this); + } + } + if (!count($sqlErrors)) { // If a moving operation took place...: