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