Procházet zdrojové kódy

Fix twig deprecation (#4276)

Fixes the deprecation:

```
Silent display of undefined block "form_message" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block('form_message') is defined" expression to test for block existence
```
Romain Neutron před 8 roky
rodič
revize
94a68f9023

+ 6 - 2
Resources/views/Form/filter_admin_fields.html.twig

@@ -50,7 +50,9 @@ file that was distributed with this source code.
                 </div>
                 </div>
             {% endif %}
             {% endif %}
         {% endfor %}
         {% endfor %}
-        {{ block('form_message') }}
+        {% if block('form_message') is defined %}
+            {{ block('form_message') }}
+        {% endif %}
         {% if expanded %}
         {% if expanded %}
             </div>
             </div>
         {% endif %}
         {% endif %}
@@ -79,7 +81,9 @@ file that was distributed with this source code.
         {% endif %}
         {% endif %}
         {% if form.parent != null and 'choice' not in form.parent.vars.block_prefixes %}
         {% if form.parent != null and 'choice' not in form.parent.vars.block_prefixes %}
             </div>
             </div>
-            {{ block('form_message') }}
+            {% if block('form_message') is defined %}
+                {{ block('form_message') }}
+            {% endif %}
         {% endif %}
         {% endif %}
     {% endspaceless %}
     {% endspaceless %}
 {% endblock checkbox_widget %}
 {% endblock checkbox_widget %}

+ 1 - 1
composer.json

@@ -40,7 +40,7 @@
         "symfony/twig-bridge": "^2.3.5 || ^3.0",
         "symfony/twig-bridge": "^2.3.5 || ^3.0",
         "symfony/validator": "^2.3 || ^3.0",
         "symfony/validator": "^2.3 || ^3.0",
         "twig/extensions": "^1.0",
         "twig/extensions": "^1.0",
-        "twig/twig": "^1.26"
+        "twig/twig": "^1.28"
     },
     },
     "require-dev": {
     "require-dev": {
         "jms/di-extra-bundle": "^1.7",
         "jms/di-extra-bundle": "^1.7",