Project

General

Profile

Feature #19611 » 9793.patch

Administrator Admin, 2008-11-14 10:54

View differences:

class.t3lib_tcemain.php
* @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)) {
......
// 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';
......
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...:
(1-1/3)