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 2521d796c2eb534aa450d667cdb091c00101f789..9729ca3b8146335f09c43382828b164e7ab4553f 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 @@ -68,23 +68,27 @@ else:\n params = context.portal_selections.getSelectionParamsFor(\'search_result_selection\')\n search_words = params.get(\'your_search_text\')\n \n -if document_text is None:\n - document_text = context.getSearchableText()\n +if search_words is None:\n + return \'\'\n +else:\n +\n + if document_text is None:\n + document_text = context.getSearchableText()\n \n -found_text_fragments = context.Base_getExcerptText(\n - context, \\\n - document_text, \\\n - search_words, \\\n - tags = (\'<em>\', \'</em>\'), \\\n - trail = 5, \\\n - maxlines = max_lines)\n -result = \' \'.join(map(str, found_text_fragments))\n + found_text_fragments = context.Base_getExcerptText(\n + context, \\\n + document_text, \\\n + search_words, \\\n + tags = (\'<em>\', \'</em>\'), \\\n + trail = 5, \\\n + maxlines = max_lines)\n + result = \' \'.join(map(str, found_text_fragments))\n \n -# Document may contains charactors which utf8 codec cannot decode.\n -unicode_result = result.decode(\'utf-8\', \'ignore\')\n -result = unicode_result.encode(\'utf-8\')\n + # Document may contains charactors which utf8 codec cannot decode.\n + unicode_result = result.decode(\'utf-8\', \'ignore\')\n + result = unicode_result.encode(\'utf-8\')\n \n -return result\n + return result\n ]]></string> </value> diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index 04170a3632b3d39766d3735a59b34e5e491f10f4..65150d2b694a556473793f9d26d2ce8d42fb5a2d 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -1151 \ No newline at end of file +1153 \ No newline at end of file