Show in log which fields were changed in a ElementEditedLogEntry.

This commit is contained in:
Jan Böhmer 2020-02-23 20:16:28 +01:00
parent 181e0f72ed
commit 2bc6a2be3c
2 changed files with 31 additions and 1 deletions

View file

@ -144,10 +144,22 @@ class LogEntryExtraFormatter
}
if ($context instanceof ElementEditedLogEntry) {
$str = '';
if ($context->hasComment()) {
return htmlspecialchars($context->getComment());
$str .= htmlspecialchars($context->getComment());
}
if ($context->hasChangedFieldsInfo()) {
if (!empty($str)) {
$str .= '; ';
}
$str .= sprintf(
"<i>%s:</i> %s",
$this->translator->trans('log.element_edited.changed_fields'),
htmlspecialchars(implode(', ', $context->getChangedFields()))
);
}
return $str;
}
if ($context instanceof InstockChangedLogEntry) {