ENHANCEMENT: Updated Versioned::compareVersions() to use DataDifferencer

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77660 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-05-23 03:29:33 +00:00
parent 82f803601a
commit cc93959d7f

View File

@ -520,16 +520,8 @@ class Versioned extends DataObjectDecorator {
$fromRecord = Versioned::get_version($this->owner->class, $this->owner->ID, $from);
$toRecord = Versioned::get_version($this->owner->class, $this->owner->ID, $to);
$fields = array_keys($fromRecord->getAllFields());
foreach($fields as $field) {
if(in_array($field, array("ID","Version","RecordID","AuthorID", "ParentID"))) continue;
$fromRecord->$field = Diff::compareHTML($fromRecord->$field, $toRecord->$field);
}
return $fromRecord;
$diff = new DataDifferencer($fromRecord, $toRecord);
return $diff->diffedData();
}
/**