mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-04 20:36:03 +01:00
fix copying of pages [fixes #43]
This commit is contained in:
@@ -718,8 +718,7 @@ class AdminController
|
|||||||
$data = $this->post;
|
$data = $this->post;
|
||||||
|
|
||||||
// Find new parent page in order to build the path.
|
// Find new parent page in order to build the path.
|
||||||
$parent = empty($data['route']) ? $pages->root() : $pages->dispatch($data['route'], true);
|
$parent = empty(trim($data['route'], '/')) ? $pages->root() : $pages->dispatch($data['route'], true);
|
||||||
|
|
||||||
// And then get the current page.
|
// And then get the current page.
|
||||||
$page = $this->admin->page(true);
|
$page = $this->admin->page(true);
|
||||||
|
|
||||||
@@ -727,6 +726,9 @@ class AdminController
|
|||||||
$page = $page->copy($parent);
|
$page = $page->copy($parent);
|
||||||
$this->preparePage($page);
|
$this->preparePage($page);
|
||||||
|
|
||||||
|
// Make sure the header is loaded in case content was set through raw() (expert mode)
|
||||||
|
$page->header();
|
||||||
|
|
||||||
// Deal with folder naming conflicts, but limit number of searches to 99.
|
// Deal with folder naming conflicts, but limit number of searches to 99.
|
||||||
$break = 99;
|
$break = 99;
|
||||||
while ($break > 0 && file_exists($page->filePath())) {
|
while ($break > 0 && file_exists($page->filePath())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user