Bug #16166 » 3531_t3lib_tcemain.diff
t3lib/class.t3lib_tcemain.php (.../branches/bug-3531) (Revision 48) | ||
---|---|---|
* @return void
|
||
*/
|
||
function version_swap($table,$id,$swapWith,$swapIntoWS=0) {
|
||
global $TCA;
|
||
global $TCA,$TYPO3_CONF_VARS;
|
||
/*
|
||
Version ID swapping principles:
|
||
... | ... | |
}
|
||
}
|
||
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 ($table == 'tt_content') {
|
||
// first swap the records for the new element to the negative uid
|
||
$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_dam_mm_ref', 'uid_foreign='.$swapWith, Array('uid_foreign' => -$swapWith));
|
||
|
||
// then swap the old record to the new uid
|
||
$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_dam_mm_ref', 'uid_foreign='.$id, Array('uid_foreign' => $swapWith));
|
||
|
||
// and then finally swap the new record to the old uid
|
||
$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_dam_mm_ref', 'uid_foreign=-'.$swapWith, Array('uid_foreign' => $id));
|
||
}
|
||
|
||
if (!count($sqlErrors)) {
|
||
// Checking for delete:
|