Commit 6d77771c authored by Romain Courteaud's avatar Romain Courteaud

Base_showFoundText should not raise NotConvertedError when document is not...

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
parent 9a1ebd19
......@@ -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
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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment