Fixed fieldset field not allowing to properly save when contained within a list (fixes #1225)

This commit is contained in:
Djamil Legato
2017-09-25 18:37:12 -07:00
parent 0378738e73
commit eb1f1caa66
2 changed files with 25 additions and 12 deletions

View File

@@ -4,6 +4,7 @@
1. [](#bugfix) 1. [](#bugfix)
* Fix editor not clickable in list field [#1224](https://github.com/getgrav/grav-plugin-admin/pull/1124) * Fix editor not clickable in list field [#1224](https://github.com/getgrav/grav-plugin-admin/pull/1124)
* Updated Google Font URLs to always connect over HTTPS. [#1106](https://github.com/getgrav/grav-plugin-admin/pull/1106) * Updated Google Font URLs to always connect over HTTPS. [#1106](https://github.com/getgrav/grav-plugin-admin/pull/1106)
* Fixed fieldset field not allowing to properly save when contained within a list [#1225](https://github.com/getgrav/grav-plugin-admin/issues/1225)
# v1.6.0 # v1.6.0
## 09/07/2017 ## 09/07/2017

View File

@@ -49,14 +49,26 @@
{% block group %} {% block group %}
{% if field.text %} {% if field.text %}
<p>{% if grav.twig.twig.filters['tu'] is defined %}{{ field.text|tu }}{% else %}{{ field.text|t }}{% endif %}<p> <p>{% if grav.twig.twig.filters['tu'] is defined %}{{ field.text|tu }}{% else %}{{ field.text|t }}{% endif %}
<p>
{% endif %} {% endif %}
{% if field.fields %} {% if field.fields %}
{% for field in field.fields %} {%- for childName, child in field.fields -%}
{%- if childName starts with '.' -%}
{%- set childKey = childName|trim('.') -%}
{%- set childName = itemName ~ childName -%}
{%- else %}
{%- set childKey = childName -%}
{%- set childName = childName|replace({'*': key}) -%}
{%- endif %}
{%- set child = child|merge({ name: childName }) -%}
{% if field.type %} {% if field.type %}
{% set value = field.name ? data.value(field.name) : data.toArray %} {%- include [
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %} "forms/fields/#{child.type}/#{child.type}.html.twig",
'forms/fields/text/text.html.twig'
] with { field: child, value: data.value(child.name) } -%}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}