Fixed admin_route() twig function to work properly with Grav 1.7.0-rc.4, which fixes Route base

This commit is contained in:
Matias Griese
2020-01-28 18:56:37 +02:00
parent d46200123c
commit 0e043aa0a9
2 changed files with 4 additions and 1 deletions

View File

@@ -13,6 +13,7 @@
* Fixed saving data with empty field, default value (from config, plugin, theme) was used instead
* Fixed JS bug is using empty Grav URI param key
* Fixed bug in toggleable field being disabled with empty value (`''` `0`, `false`, `[]`...)
* Fixed `admin_route()` twig function to work properly with Grav 1.7.0-rc.4, which fixes `Route` base
# v1.10.0-rc.3
## 01/02/2020

View File

@@ -314,13 +314,15 @@ class Admin
$languageCode = $languageCode ?? $language->getActive();
$languagePrefix = $languageCode ? '/' . $languageCode : '';
$root = $this->grav['uri']->rootUrl();
$parts = [
'path' => $path,
'query' => '',
'query_params' => [],
'grav' => [
// TODO: Make URL to be /admin/en, not /en/admin.
'root' => preg_replace('`//+`', '/', RouteFactory::getRoot() . $languagePrefix . $this->base),
'root' => preg_replace('`//+`', '/', $root . $languagePrefix . $this->base),
'language' => '', //$languageCode,
'route' => ltrim($path, '/'),
'params' => ''