diff --git a/classes/admin.php b/classes/admin.php index 2bc92b22..0f8e01d6 100644 --- a/classes/admin.php +++ b/classes/admin.php @@ -222,10 +222,11 @@ class Admin case 'configuration': case 'system': $type = 'system'; - $blueprints = $this->blueprints($type); - $file = YamlFile::instance(USER_DIR . "config/{$type}.yaml"); - $obj = new Data\Data($file->content(), $blueprints); + $blueprints = $this->blueprints("config/{$type}"); + $config = $this->grav['config']; + $obj = new Data\Data($config->get('system'), $blueprints); $obj->merge($post); + $file = YamlFile::instance(USER_DIR . "config/{$type}.yaml"); $obj->file($file); $data[$type] = $obj; break; @@ -233,10 +234,11 @@ class Admin case 'settings': case 'site': $type = 'site'; - $blueprints = $this->blueprints($type); - $file = YamlFile::instance(USER_DIR . "config/{$type}.yaml"); - $obj = new Data\Data($file->content(), $blueprints); + $blueprints = $this->blueprints("config/{$type}"); + $config = $this->grav['config']; + $obj = new Data\Data($config->get('site'), $blueprints); $obj->merge($post); + $file = YamlFile::instance(USER_DIR . "config/{$type}.yaml"); $obj->file($file); $data[$type] = $obj; break; diff --git a/themes/grav/templates/configuration.html.twig b/themes/grav/templates/configuration.html.twig index 293ec7cd..97847f01 100644 --- a/themes/grav/templates/configuration.html.twig +++ b/themes/grav/templates/configuration.html.twig @@ -15,6 +15,7 @@ {% endblock %} {% block content %} - {% include 'partials/blueprints.html.twig' with { blueprints: admin.blueprints('config/system'), data: admin.data('system') } %} + {% set data = admin.data('system') %} + {% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %} {% endblock %} diff --git a/themes/grav/templates/forms/fields/section/section.html.twig b/themes/grav/templates/forms/fields/section/section.html.twig index 1f7f9fe6..cd92d694 100644 --- a/themes/grav/templates/forms/fields/section/section.html.twig +++ b/themes/grav/templates/forms/fields/section/section.html.twig @@ -11,7 +11,7 @@ {% for field in field.fields %} {% if field.type %} {% set value = data.value(field.name) %} - {% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %} + {% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %} {% endif %} {% endfor %} diff --git a/themes/grav/templates/partials/blueprints-new.html.twig b/themes/grav/templates/partials/blueprints-new.html.twig index ebcb42fa..f05fd841 100644 --- a/themes/grav/templates/partials/blueprints-new.html.twig +++ b/themes/grav/templates/partials/blueprints-new.html.twig @@ -1,4 +1,6 @@ -