From 26d19731101ff383bc770e008a0c07875a3a8774 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 20 Aug 2015 20:45:39 +0300 Subject: [PATCH] Fix blueprints loading (regression from #38) --- system/src/Grav/Common/Data/Blueprints.php | 1 + system/src/Grav/Common/Plugins.php | 4 ++-- system/src/Grav/Common/Themes.php | 4 ++-- system/src/Grav/Common/User/User.php | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/system/src/Grav/Common/Data/Blueprints.php b/system/src/Grav/Common/Data/Blueprints.php index 629c089ec..5894357c4 100644 --- a/system/src/Grav/Common/Data/Blueprints.php +++ b/system/src/Grav/Common/Data/Blueprints.php @@ -37,6 +37,7 @@ class Blueprints public function get($type) { if (!isset($this->instances[$type])) { + $parents = []; if (is_string($this->search)) { $filename = $this->search . $type . YAML_EXT; diff --git a/system/src/Grav/Common/Plugins.php b/system/src/Grav/Common/Plugins.php index dd5fb74a0..addf33ad8 100644 --- a/system/src/Grav/Common/Plugins.php +++ b/system/src/Grav/Common/Plugins.php @@ -113,8 +113,8 @@ class Plugins extends Iterator public static function get($name) { - $blueprints = new Blueprints("plugins://{$name}"); - $blueprint = $blueprints->get('blueprints'); + $blueprints = new Blueprints('plugins://'); + $blueprint = $blueprints->get("{$name}/blueprints"); $blueprint->name = $name; // Load default configuration. diff --git a/system/src/Grav/Common/Themes.php b/system/src/Grav/Common/Themes.php index 516a9d2fb..8b0866a1e 100644 --- a/system/src/Grav/Common/Themes.php +++ b/system/src/Grav/Common/Themes.php @@ -90,8 +90,8 @@ class Themes extends Iterator throw new \RuntimeException('Theme name not provided.'); } - $blueprints = new Blueprints("themes://{$name}"); - $blueprint = $blueprints->get('blueprints'); + $blueprints = new Blueprints('themes://'); + $blueprint = $blueprints->get("{$name}/blueprints"); $blueprint->name = $name; // Find thumbnail. diff --git a/system/src/Grav/Common/User/User.php b/system/src/Grav/Common/User/User.php index 0bf86055a..7fdc24ca4 100644 --- a/system/src/Grav/Common/User/User.php +++ b/system/src/Grav/Common/User/User.php @@ -32,8 +32,8 @@ class User extends Data $locator = self::getGrav()['locator']; // TODO: validate directory name - $blueprints = new Blueprints('blueprints://user'); - $blueprint = $blueprints->get('account'); + $blueprints = new Blueprints('blueprints://'); + $blueprint = $blueprints->get('user/account'); $file_path = $locator->findResource('account://' . $username . YAML_EXT); $file = CompiledYamlFile::instance($file_path); $content = $file->content();