1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Fixed bug preventing page revision restore

Added regression tests to cover.
Fixes #341
This commit is contained in:
Dan Brown
2017-03-23 22:19:14 +00:00
parent 668ce26269
commit cc0ce7c630
2 changed files with 28 additions and 1 deletions

View File

@ -1058,7 +1058,7 @@ class EntityRepo
public function restorePageRevision(Page $page, Book $book, $revisionId)
{
$this->savePageRevision($page);
$revision = $this->getById('page_revision', $revisionId);
$revision = $page->revisions()->where('id', '=', $revisionId)->first();
$page->fill($revision->toArray());
$page->slug = $this->findSuitableSlug('page', $page->name, $page->id, $book->id);
$page->text = strip_tags($page->html);