ENHANCEMENT: Updated Versioned::compareVersions() to use DataDifferencer. Merged from trunk r77660

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@81933 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Will Rossiter 2009-07-15 23:07:39 +00:00 committed by Sam Minnee
parent 004ff37700
commit 261c976435

View File

@ -466,17 +466,9 @@ class Versioned extends DataObjectDecorator {
function compareVersions($from, $to) {
$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();
}
/**