From 1ffc9c3b4cb229a19bfad11e42077a2312aaf3c5 Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Thu, 19 Jun 2008 14:51:18 +0000
Subject: [PATCH] Do not try to show in search mode bolded found text
 fragmenrts in case document has no base data (i.e. not converted).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21711 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_dms/Base_showFoundText.xml       | 10 ++++++++--
 bt5/erp5_dms/bt/revision                               |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml
index ea966e0003..c8b7388a21 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml
@@ -75,8 +75,14 @@
 """\n
 # convert object to text (if possible)\n
 document_text = \'\'\n
-if getattr(context, \'asText\', None) is not None:\n
-  document_text = context.asText()\n
+if getattr(context, \'asText\', None) is not None and \\\n
+     getattr(context, \'hasBaseData\', None) is not None:\n
+  if context.hasBaseData():\n
+    # document is successfully converted\n
+    document_text = context.asText()\n
+  else:\n
+    # document not converted (due to a conversion error), return message to user\n
+    return context.Base_translateString(\'Document is not converted.\')\n
 \n
 # get search words from listbox selection\n
 argument_names = (\'advanced_search_text\', \n
diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision
index 3f7ea5fb78..721527c693 100644
--- a/bt5/erp5_dms/bt/revision
+++ b/bt5/erp5_dms/bt/revision
@@ -1 +1 @@
-895
\ No newline at end of file
+896
\ No newline at end of file
-- 
2.30.9