2 namespace TYPO3\CMS\Workspaces\Service;
58 foreach ((array)$this->getHistoryObject($table, $id)->changeLog as $entry) {
77 if (!empty($entry[
'action'])) {
78 $differences = $entry[
'action'];
84 'user' => htmlspecialchars($this->
getUserName($entry[
'user'])),
85 'differences' => $differences
98 $differences = array();
99 $tableName = $entry[
'tablename'];
100 if (is_array($entry[
'newRecord'])) {
101 $fields = array_keys($entry[
'newRecord']);
102 foreach ($fields as $field) {
103 if (!empty(
$GLOBALS[
'TCA'][$tableName][
'columns'][$field][
'config'][
'type']) &&
$GLOBALS[
'TCA'][$tableName][
'columns'][$field][
'config'][
'type'] !==
'passthrough') {
106 BackendUtility::getProcessedValue($tableName, $field, $entry[
'oldRecord'][$field], 0,
true),
107 BackendUtility::getProcessedValue($tableName, $field, $entry[
'newRecord'][$field], 0,
true)
109 if (!empty($fieldDifferences)) {
110 $differences[] = array(
112 'html' => nl2br(trim($fieldDifferences)),
129 $userName =
'unknown';
130 if (!empty($this->backendUserNames[$user][
'username'])) {
131 $userName = $this->backendUserNames[$user][
'username'];
143 protected function getHistoryObject($table, $id)
145 if (!isset($this->historyObjects[$table][$id])) {
147 $historyObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\History\RecordHistory::class);
148 $historyObject->element = $table .
':' . $id;
149 $historyObject->createChangeLog();
150 $this->historyObjects[$table][$id] = $historyObject;
152 return $this->historyObjects[$table][$id];
162 if (!isset($this->differencesObject)) {
163 $this->differencesObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Utility\DiffUtility::class);