Index: t3lib/class.t3lib_tcemain.php =================================================================== --- t3lib/class.t3lib_tcemain.php (revision 6275) +++ t3lib/class.t3lib_tcemain.php (working copy) @@ -4780,6 +4780,10 @@ // 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); @@ -4813,9 +4817,19 @@ $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) {