From c05e1150872c6d140495b8916feb97e0698d745d Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Tue, 15 Dec 2015 14:52:54 +0000 Subject: [PATCH] Added comment explaining the purpose of results_image.html --- .../wagtailimages/images/results_image.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/wagtail/wagtailimages/templates/wagtailimages/images/results_image.html b/wagtail/wagtailimages/templates/wagtailimages/images/results_image.html index a782ffacb..49731bc72 100644 --- a/wagtail/wagtailimages/templates/wagtailimages/images/results_image.html +++ b/wagtail/wagtailimages/templates/wagtailimages/images/results_image.html @@ -1,4 +1,19 @@ +{% comment %} + Separated out of results.html to prevent invalid images from crashing the entire + images listing. (issue #1805) + + If an error is raised inside a template include, the error is caught by the + calling {% include %} tag and the contents blanked out. + + This behaviour caused a confusing error on the images listing view where it + would go blank if one of the images was invalid. + + Separating the image rendering code into this file allows us to limit Django's + crash/blanking behaviour to a single image so the listing can still be used when + the issue occurs. +{% endcomment %} + {% load wagtailimages_tags wagtailadmin_tags %} {% load i18n %} -
{% image image max-165x165 class="show-transparency" %}
\ No newline at end of file +
{% image image max-165x165 class="show-transparency" %}