mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Added debugger output when routes conflict
This commit is contained in:
parent
b0dd2358f4
commit
4e01398545
|
|
@ -2013,17 +2013,26 @@ class Pages
|
|||
|
||||
// add regular route
|
||||
if ($route) {
|
||||
if (isset($this->routes[$route]) && $this->routes[$route] !== $page_path) {
|
||||
$this->grav['debugger']->addMessage("Route '{$route}' already exists: {$this->routes[$route]}, overwriting with {$page_path}");
|
||||
}
|
||||
$this->routes[$route] = $page_path;
|
||||
}
|
||||
|
||||
// add raw route
|
||||
if ($raw_route && $raw_route !== $route) {
|
||||
if ($raw_route) {
|
||||
if (isset($this->routes[$raw_route]) && $this->routes[$route] !== $page_path) {
|
||||
$this->grav['debugger']->addMessage("Raw Route '{$raw_route}' already exists: {$this->routes[$raw_route]}, overwriting with {$page_path}");
|
||||
}
|
||||
$this->routes[$raw_route] = $page_path;
|
||||
}
|
||||
|
||||
// add canonical route
|
||||
$route_canonical = $page->routeCanonical();
|
||||
if ($route_canonical && $route !== $route_canonical) {
|
||||
if ($route_canonical) {
|
||||
if (isset($this->routes[$route_canonical]) && $this->routes[$route_canonical] !== $page_path) {
|
||||
$this->grav['debugger']->addMessage("Canonical Route '{$route_canonical}' already exists: {$this->routes[$route_canonical]}, overwriting with {$page_path}");
|
||||
}
|
||||
$this->routes[$route_canonical] = $page_path;
|
||||
}
|
||||
|
||||
|
|
@ -2031,6 +2040,9 @@ class Pages
|
|||
$route_aliases = $page->routeAliases();
|
||||
if ($route_aliases) {
|
||||
foreach ($route_aliases as $alias) {
|
||||
if (isset($this->routes[$alias]) && $this->routes[$alias] !== $page_path) {
|
||||
$this->grav['debugger']->addMessage("Alias Route '{$alias}' already exists: {$this->routes[$alias]}, overwriting with {$page_path}");
|
||||
}
|
||||
$this->routes[$alias] = $page_path;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user