Fix #1034 redirect of page creation procedure when system.home.hide_in_urls is enabled

This commit is contained in:
Flavio Copes
2016-09-13 13:45:09 +02:00
parent 838dfe7a65
commit fd8c7889d1
2 changed files with 11 additions and 5 deletions

View File

@@ -1,8 +1,14 @@
# v1.2.x
## 09/xx/2016
1. [](#bugfix)
* Fix [#1034](https://github.com/getgrav/grav-plugin-admin/issues/1034) redirect of page creation procedure when system.home.hide_in_urls is enabled
# v1.2.2
## 09/08/2016
1. [](#bugfix)
* Fix [#767](https://github.com/getgrav/grav-plugin-admin/issues/739) Add styling for new HTML5 input field types
* Fix [#767](https://github.com/getgrav/grav-plugin-admin/issues/767) Add styling for new HTML5 input field types
* Fix issue with checking the package dependencies when more than one package is being inspected
# v1.2.1

View File

@@ -1987,14 +1987,14 @@ class AdminController
$home_route = $config->get('system.home.alias');
$topParent = $obj->topParent();
if (isset($topParent)) {
if ($topParent->route() == $home_route) {
$route = (string)$topParent->route() . $route;
$top_parent_route = (string)$topParent->route();
if ($top_parent_route == $home_route && substr($route, 0, strlen($top_parent_route) + 1) != ($top_parent_route . '/')) {
$route = $top_parent_route . $route;
}
}
}
$redirect_url = '/' . ($multilang ? ($obj->language()) : '') . $admin_route . '/' . $this->view . $route;
$redirect_url = ($multilang ? '/' . $obj->language() : '') . $admin_route . '/' . $this->view . $route;
$this->setRedirect($redirect_url);
}