mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Prefill new pages with book's default template
This commit is contained in:
parent
1dbc3588cf
commit
99ae759eff
@ -148,6 +148,12 @@ class PageRepo
|
||||
$page->book_id = $parent->id;
|
||||
}
|
||||
|
||||
if ($page->book->defaultTemplate) {
|
||||
$page->forceFill([
|
||||
'html' => $page->book->defaultTemplate->html,
|
||||
]);
|
||||
}
|
||||
|
||||
$page->save();
|
||||
$page->refresh()->rebuildPermissions();
|
||||
|
||||
|
@ -74,7 +74,6 @@ class PageController extends Controller
|
||||
$page = $this->pageRepo->getNewDraftPage($parent);
|
||||
$this->pageRepo->publishDraft($page, [
|
||||
'name' => $request->get('name'),
|
||||
'html' => '',
|
||||
]);
|
||||
|
||||
return redirect($page->getUrl('/edit'));
|
||||
|
Loading…
Reference in New Issue
Block a user