Explorar o código

Update form_admin_fields.html.twig

apparently not all sonata_admin.field_description have options set,
hence it comes to problems 

prevents https://github.com/sonata-project/sandbox/issues/499
prevents https://github.com/sonata-project/sandbox/issues/504
Peter Petermann %!s(int64=10) %!d(string=hai) anos
pai
achega
4813b5d9b5
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      Resources/views/Form/form_admin_fields.html.twig

+ 3 - 1
Resources/views/Form/form_admin_fields.html.twig

@@ -235,7 +235,9 @@ file that was distributed with this source code.
 
 {% block form_row %}
     <div class="form-group{% if errors|length > 0 %} has-error{% endif %}" id="sonata-ba-field-container-{{ id }}">
-        {% set label = sonata_admin.field_description.options.name|default(label)  %}
+        {% if sonata_admin.field_description.options is defined %}
+            {% set label = sonata_admin.field_description.options.name|default(label)  %}
+        {% endif %}
 
         {% set div_class = 'sonata-ba-field' %}