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

Updated page delete to return to chapter if within one

- Added test to cover

Closes #1715
This commit is contained in:
Dan Brown
2019-12-16 11:54:53 +00:00
parent f122bebae7
commit 017703ff1a
2 changed files with 12 additions and 1 deletions

View File

@ -304,11 +304,12 @@ class PageController extends Controller
$this->checkOwnablePermission('page-delete', $page);
$book = $page->book;
$parent = $page->chapter ?? $book;
$this->pageRepo->destroy($page);
Activity::addMessage('page_delete', $page->name, $book->id);
$this->showSuccessNotification(trans('entities.pages_delete_success'));
return redirect($book->getUrl());
return redirect($parent->getUrl());
}
/**