Merge pull request #5569 from silverstripe-terraformers/fixes/field-diff

Switched Diff to the escaped variable created
This commit is contained in:
Daniel Hensby 2016-05-20 01:26:41 +01:00
commit 4c4154115f

View File

@ -213,9 +213,7 @@ class DataDifferencer extends ViewableData {
$changedFields->push(new ArrayData(array( $changedFields->push(new ArrayData(array(
'Name' => $field, 'Name' => $field,
'Title' => $base->fieldLabel($field), 'Title' => $base->fieldLabel($field),
'Diff' => $this->fromRecord 'Diff' => $fieldDiff,
? Diff::compareHTML($this->fromRecord->$field, $this->toRecord->$field)
: "<ins>" . $this->toRecord->$field . "</ins>",
'From' => $this->fromRecord ? $this->fromRecord->$field : null, 'From' => $this->fromRecord ? $this->fromRecord->$field : null,
'To' => $this->toRecord ? $this->toRecord->$field : null, 'To' => $this->toRecord ? $this->toRecord->$field : null,
))); )));