mirror of
				https://github.com/getgrav/grav-plugin-admin.git
				synced 2025-11-03 20:05:53 +01:00 
			
		
		
		
	Fixed admin_route() twig function to work properly with Grav 1.7.0-rc.4, which fixes Route base
				
					
				
			This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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' => ''
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user