mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-08 15:50:21 +08:00
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
@ -306,9 +306,14 @@ class PageRepo
|
|||||||
throw new PermissionsException('User does not have permission to create a page within the new parent');
|
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->changeBook($parent instanceof Book ? $parent->id : $parent->book->id);
|
||||||
$page->rebuildPermissions();
|
$page->rebuildPermissions();
|
||||||
return $parent;
|
|
||||||
|
return ($parent instanceof Book ? $parent : $parent->book);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user