1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Updated sort logic to handle chapter to book scenario

- Extended tests out to cover
This commit is contained in:
Dan Brown
2019-10-29 22:33:09 +00:00
parent e108808a32
commit d64c358c4f
2 changed files with 20 additions and 5 deletions

View File

@ -306,10 +306,7 @@ class PageRepo
throw new PermissionsException('User does not have permission to create a page within the new parent');
}
if ($parent instanceof Chapter) {
$page->chapter_id = $parent->id;
}
$page->chapter_id = ($parent instanceof Chapter) ? $parent->id : null;
$page->changeBook($parent instanceof Book ? $parent->id : $parent->book->id);
$page->rebuildPermissions();