Skip to content

Commit

Permalink
FIX file history not displaying (#1233)
Browse files Browse the repository at this point in the history
This is caused by the humanizedChanges() function where the version grabbed didn't include the deleted/archived version.
  • Loading branch information
Jianbinzhu authored Jan 17, 2022
1 parent 90e6396 commit 1a60cb6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/Controller/AssetAdminFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ public function humanizedChanges($from, $to)
return _t('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.UPLOADEDFILE', "Uploaded file");
}

$fromRecord = Versioned::get_version(get_class($this->owner), $this->owner->ID, $from);
$toRecord = Versioned::get_version(get_class($this->owner), $this->owner->ID, $to);
$fromRecord = Versioned::get_all_versions(get_class($this->owner), $this->owner->ID)
->find('Version', $from);
$toRecord = Versioned::get_all_versions(get_class($this->owner), $this->owner->ID)
->find('Version', $to);

$diff = new DataDifferencer($fromRecord, $toRecord);
$changes = $diff->changedFieldNames();
Expand Down

0 comments on commit 1a60cb6

Please sign in to comment.