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:
@ -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);
|
||||
|
Reference in New Issue
Block a user