From 6d77771c5a7b6dab17a3bc5f95f4d0d25829db63 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Fri, 9 Oct 2009 10:09:13 +0000
Subject: [PATCH] Base_showFoundText should not raise NotConvertedError when
 document is not converted. Instead, it should display a message ("This
 document is not converted yet.")

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29515 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_core/Base_showFoundText.xml         | 8 +++++++-
 product/ERP5/bootstrap/erp5_core/bt/revision              | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_showFoundText.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_showFoundText.xml
index 969de4f431..54e8359b37 100644
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_showFoundText.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_showFoundText.xml
@@ -61,6 +61,7 @@
   containing searched words as well highlighting the searched \n
   words in the text itself.\n
 """\n
+from Products.ERP5.Document.Document import NotConvertedError\n
 \n
 is_gadget_mode = context.REQUEST.get(\'is_gadget_mode\', 0)\n
 \n
@@ -89,7 +90,10 @@ argument_names = (\'advanced_search_text\', \n
                   \'searchabletext_phrase\',)\n
 \n
 if document_text is None:\n
-  document_text = context.getSearchableText()\n
+  try:\n
+    document_text = context.getSearchableText()\n
+  except NotConvertedError:\n
+    return context.Base_translateString("This document is not converted yet.")\n
 \n
 if selection is not None:\n
   params = selection.getParams()\n
@@ -166,6 +170,8 @@ else:\n
                             <string>selection</string>
                             <string>max_lines</string>
                             <string>max_text_length</string>
+                            <string>Products.ERP5.Document.Document</string>
+                            <string>NotConvertedError</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>is_gadget_mode</string>
diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision
index 2d14433bf8..4db8f571c2 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/revision
+++ b/product/ERP5/bootstrap/erp5_core/bt/revision
@@ -1 +1 @@
-1326
+1327
\ No newline at end of file
-- 
2.30.9