소스 검색

Added check if sortable variable is defined in form_admin_fields.html.twig

This fixes edge case if someone is using overloaded choice type in his project without changes in template.
Andrej Hudec 10 년 전
부모
커밋
381c376e21
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Resources/views/Form/form_admin_fields.html.twig

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

@@ -155,7 +155,7 @@ file that was distributed with this source code.
         {% set required = false %}
     {% endif %}
     {% set attr = attr|merge({'class': attr.class|default('') ~ ' form-control'}) %}
-    {% if sortable and multiple %}
+    {% if (sortable is defined) and sortable and multiple %}
         {{ block('sonata_type_choice_multiple_sortable') }}
     {% else %}
         <select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %} >