mirror of
https://github.com/getgrav/grav.git
synced 2026-02-01 04:10:02 +01:00
Fix moving the page to the root
$parent->route() returned null when moving to the root
This commit is contained in:
@@ -658,9 +658,12 @@ class Page
|
||||
if ($parent->path()) {
|
||||
$clone->path($parent->path() . '/' . $clone->folder());
|
||||
}
|
||||
|
||||
// TODO: make sure we always have the route.
|
||||
if ($parent->route()) {
|
||||
$clone->route($parent->route() . '/'. $clone->slug());
|
||||
} else {
|
||||
$clone->route(self::getGrav()['pages']->root()->route() . '/'. $clone->slug());
|
||||
}
|
||||
|
||||
return $clone;
|
||||
|
||||
Reference in New Issue
Block a user