浏览代码

Merge pull request #2784 from EmmanuelVella/admin-pool

Check if admin_pool is defined in admin form template
Thomas 10 年之前
父节点
当前提交
69ea825525
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Resources/views/Form/form_admin_fields.html.twig

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

@@ -63,7 +63,7 @@ file that was distributed with this source code.
 {# Labels #}
 {% block form_label %}
 {% spaceless %}
-    {% if label is not sameas(false) and admin_pool.getOption('form_type') == 'horizontal' %}
+    {% if label is not sameas(false) and admin_pool is defined and admin_pool.getOption('form_type') == 'horizontal' %}
         {% set label_class = 'col-sm-3' %}
     {% endif %}
 
@@ -167,7 +167,7 @@ file that was distributed with this source code.
             {% set div_class = div_class ~ ' sonata-collection-row-without-label' %}
         {% endif %}
 
-        {% if admin_pool.getOption('form_type') == 'horizontal' %}
+        {% if admin_pool is defined and admin_pool.getOption('form_type') == 'horizontal' %}
             {% if label is sameas(false) %}
                 {% if 'collection' in form.parent.vars.block_prefixes %}
                     {% set div_class = div_class ~ ' col-sm-12' %}
@@ -266,7 +266,7 @@ file that was distributed with this source code.
             {{ form_label(child) }}
 
             {% set div_class = "" %}
-            {% if admin_pool.getOption('form_type') == 'horizontal' %}
+            {% if admin_pool is defined and admin_pool.getOption('form_type') == 'horizontal' %}
                 {% set div_class = 'col-sm-9' %}
             {% endif%}