Automatic Restored Revision Changelog Summary Text

This commit is contained in:
Anthony Ronda 2020-11-03 20:46:47 -05:00
parent 82e671a06d
commit 34dc4a1b6d
2 changed files with 4 additions and 2 deletions

View File

@ -273,9 +273,10 @@ class PageRepo
public function restoreRevision(Page $page, int $revisionId): Page
{
$page->revision_count++;
$this->savePageRevision($page);
$revision = $page->revisions()->where('id', '=', $revisionId)->first();
$summary = trans('entities.pages_revision_restored_from', ['id' => strval($revisionId), 'summary' => $revision->summary]);
$this->savePageRevision($page, $summary);
$page->fill($revision->toArray());
$content = new PageContent($page);
$content->setNewHTML($revision->html);

View File

@ -208,6 +208,7 @@ return [
'pages_revisions' => 'Page Revisions',
'pages_revisions_named' => 'Page Revisions for :pageName',
'pages_revision_named' => 'Page Revision for :pageName',
'pages_revision_restored_from' => 'Restored from #:id ":summary"',
'pages_revisions_created_by' => 'Created By',
'pages_revisions_date' => 'Revision Date',
'pages_revisions_number' => '#',