Merge branch 'feature_move_page_into_chapter' of git://github.com/philjak/BookStack into philjak-feature_move_page_into_chapter

This commit is contained in:
Dan Brown 2019-10-29 22:26:11 +00:00
commit e108808a32
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -306,9 +306,14 @@ 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->changeBook($parent instanceof Book ? $parent->id : $parent->book->id);
$page->rebuildPermissions();
return $parent;
return ($parent instanceof Book ? $parent : $parent->book);
}
/**