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:
commit
e108808a32
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue