Fix moving the page to the root

$parent->route() returned null when moving to the root
This commit is contained in:
Flavio Copes
2015-08-03 10:19:56 +02:00
parent e9cc34f481
commit bc5ea13821

View File

@@ -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;