From ac8a98871e85a01f321b40294e0f4786d0dba285 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 15 Feb 2022 17:15:07 +0100 Subject: [PATCH] minor #16506 [Form] Update create_form_type_extension.rst (issamkhadiri1989) This PR was submitted for the 6.0 branch but it was merged into the 5.4 branch instead. Discussion ---------- [Form] Update create_form_type_extension.rst Hello, I think the condition `image_url is not null` is not enough as if we create a FileType form field without the `image_property` it causes an error. Adding `image_url is defined` is necessary because the variable `image_url` is only defined and passed to the view when `image_property` is already defined. Commits ------- 85470c59f Update create_form_type_extension.rst --- form/create_form_type_extension.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/form/create_form_type_extension.rst b/form/create_form_type_extension.rst index 9bb0abc2d8e..9e0066d7be8 100644 --- a/form/create_form_type_extension.rst +++ b/form/create_form_type_extension.rst @@ -192,7 +192,7 @@ Specifically, you need to override the ``file_widget`` block: {% block file_widget %} {{ block('form_widget') }} - {% if image_url is not null %} + {% if image_url is defined and image_url is not null %} {% endif %} {% endblock %}