From 2717249cdb7e1dd08baacba0282497519aae9588 Mon Sep 17 00:00:00 2001
From: Fabien Morin <fabien@nexedi.com>
Date: Wed, 9 Dec 2009 11:03:08 +0000
Subject: [PATCH] if no thumbnail is found, do not display <img> markup. This
 avoir a 404 error.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31177 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../listbox_field_content.xml                                   | 2 +-
 bt5/erp5_web/bt/revision                                        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSection_viewLatestDocumentListGadget/listbox_field_content.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSection_viewLatestDocumentListGadget/listbox_field_content.xml
index 9c72896573..35b8d59d23 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSection_viewLatestDocumentListGadget/listbox_field_content.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSection_viewLatestDocumentListGadget/listbox_field_content.xml
@@ -307,7 +307,7 @@
             <key> <string>_text</string> </key>
             <value> <string encoding="cdata"><![CDATA[
 
-python: \'<div><a href= "%s/view"><img class="left" src="%s?display=thumbnail&format=PNG&" /><span style="font-size: normal">%s</span></a></div><p class="clear" />\' % (cell.absolute_url(), cell.Base_getThumbnailAbsoluteUrl(), cell.getDescription())
+python: \'<div><a href= "%s/view">\' % cell.absolute_url() + (cell.Base_getThumbnailAbsoluteUrl() is not None and \'<img class="left" src="%s?display=thumbnail&format=PNG&" />\' % cell.Base_getThumbnailAbsoluteUrl() or \'\') + \'<span style="font-size: normal">%s</span></a></div><p class="clear" />\' % cell.getDescription()
 
 ]]></string> </value>
         </item>
diff --git a/bt5/erp5_web/bt/revision b/bt5/erp5_web/bt/revision
index aabe32b8ba..abb531abb7 100644
--- a/bt5/erp5_web/bt/revision
+++ b/bt5/erp5_web/bt/revision
@@ -1 +1 @@
-874
\ No newline at end of file
+876
\ No newline at end of file
-- 
2.30.9