From b630c5cf275c4fa56bfd415eee21c19f0f7d5b4f Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Wed, 10 Feb 2016 17:44:57 +0100 Subject: [PATCH] Fix issue with config blueprints auto creating config yaml files Solves a regression with streams config appearing in the Admin Configuration and a yaml being automatically created in the user config folder --- admin.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/admin.php b/admin.php index 0d96b067..6f098701 100644 --- a/admin.php +++ b/admin.php @@ -540,6 +540,15 @@ class AdminPlugin extends Plugin throw new \RuntimeException('One of the required plugins is missing or not enabled'); } + // Double check we have system.yaml and site.yaml + $config_files[] = $this->grav['locator']->findResource('user://config') . '/system.yaml'; + $config_files[] = $this->grav['locator']->findResource('user://config') . '/site.yaml'; + foreach ($config_files as $config_file) { + if (!file_exists($config_file)) { + touch($config_file); + } + } + // Initialize Admin Language if needed /** @var Language $language */ $language = $this->grav['language']; @@ -567,15 +576,6 @@ class AdminPlugin extends Plugin // And store the class into DI container. $this->grav['admin'] = $this->admin; - // Double check we have system.yam, site.yaml etc - $config_path = $this->grav['locator']->findResource('user://config'); - foreach ($this->admin->configurations() as $config_file) { - $config_file = "{$config_path}/{$config_file}.yaml"; - if (!file_exists($config_file)) { - touch($config_file); - } - } - // Get theme for admin $this->theme = $this->config->get('plugins.admin.theme', 'grav');