Project

General

Profile

Bug #17919 » 0006954-historyDuringPublishing.patch

Administrator Admin, 2009-10-26 13:18

View differences:

t3lib/class.t3lib_tcemain.php (working copy)
// Registering and swapping MM relations in current and swap records:
$this->version_remapMMForVersionSwap($table,$id,$swapWith);
// Generating proper history data to prepare logging
$this->compareFieldArrayWithCurrentAndUnset($table, $id, $swapVersion);
$this->compareFieldArrayWithCurrentAndUnset($table, $swapWith, $curVersion);
// Execute swapping:
$sqlErrors = array();
$GLOBALS['TYPO3_DB']->exec_UPDATEquery($table,'uid='.intval($id),$swapVersion);
......
$this->newlog2(($swapIntoWS ? 'Swapping' : 'Publishing').' successful for table "'.$table.'" uid '.$id.'=>'.$swapWith, $table, $id, $swapVersion['pid']);
// Update reference index:
// Update reference index of the live record:
$this->updateRefIndex($table,$id);
// Set log entry for live record:
$propArr = $this->getRecordPropertiesFromRow($table, $swapVersion);
$theLogId = $this->log($table, $id, 2, $propArr['pid'], 0, "Record '%s' (%s) was updated." . ( $propArr['_ORIG_pid'] == -1 ? ' (Offline version).' : ' (Online).' ) , 10, array($propArr['header'], $table . ':' . $id), $propArr['event_pid']);
$this->setHistory($table, $id, $theLogId);
// Update reference index of the offline record:
$this->updateRefIndex($table,$swapWith);
// Set log entry for offline record:
$propArr = $this->getRecordPropertiesFromRow($table, $curVersion);
$theLogId = $this->log($table, $swapWith, 2, $propArr['pid'], 0, "Record '%s' (%s) was updated." . ( $propArr['_ORIG_pid'] == -1 ? ' (Offline version).' : ' (Online).' ) , 10, array($propArr['header'], $table . ':'. $swapWith), $propArr['event_pid']);
$this->setHistory($table, $swapWith, $theLogId);
// SWAPPING pids for subrecords:
if ($table=='pages' && $swapVersion['t3ver_swapmode']>=0) {
......
}
// Clear cache:
$this->clear_cache($table,$id);
// Checking for "new-placeholder" and if found, delete it (BUT FIRST after swapping!):
if (!$swapIntoWS && $t3ver_state['curVersion']>0) {
$this->deleteEl($table, $swapWith, TRUE, TRUE); // For delete + completely delete!
(1-1/2)