From 85470c59fdee80982eeb4760808e0376d3ecbe69 Mon Sep 17 00:00:00 2001 From: Issam KHADIRI Date: Sun, 13 Feb 2022 21:23:03 +0100 Subject: [PATCH] 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. --- 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 %}