Commit 670e18e2 authored by Bartek Górny's avatar Bartek Górny

Fixed display of found text when advanced search arguments are submitted.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12527 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 06dc8d61
...@@ -90,14 +90,17 @@ try:\n ...@@ -90,14 +90,17 @@ try:\n
except AttributeError:\n except AttributeError:\n
txt = \'\'\n txt = \'\'\n
\n \n
search_string = selection.params.get(\'SearchableText\')\n argument_names = (\'SearchableText\', \'SearchableText_any\', \'SearchableText_all\', \'SearchableText_phrase\')\n
if search_string is None:\n search_string = \' \'.join(selection.params.get(name, \'\') for name in argument_names)\n
\n
if not search_string:\n
# if the searched text is empty (e.g. because the listbox uses its own method)\n # if the searched text is empty (e.g. because the listbox uses its own method)\n
# we return something\n # we return something\n
return txt[:300]\n return txt[:300]\n
\n \n
search_argument_list = context.parseSearchString(search_string)\n search_argument_list = context.parseSearchString(search_string)\n
search_words = search_argument_list.get(\'SearchableText\')\n search_words = search_argument_list.get(\'SearchableText\')\n
\n
if search_words is None or search_words == \'\':\n if search_words is None or search_words == \'\':\n
# if the searched text is empty (e.g. because we used only parameters without pure searchable text)\n # if the searched text is empty (e.g. because we used only parameters without pure searchable text)\n
# we return something\n # we return something\n
...@@ -157,12 +160,13 @@ return \' \'.join(map(str, res))\n ...@@ -157,12 +160,13 @@ return \' \'.join(map(str, res))\n
<string>_getattr_</string> <string>_getattr_</string>
<string>txt</string> <string>txt</string>
<string>AttributeError</string> <string>AttributeError</string>
<string>argument_names</string>
<string>search_string</string> <string>search_string</string>
<string>None</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>context</string> <string>context</string>
<string>search_argument_list</string> <string>search_argument_list</string>
<string>search_words</string> <string>search_words</string>
<string>None</string>
<string>min</string> <string>min</string>
<string>len</string> <string>len</string>
<string>res</string> <string>res</string>
......
480 483
\ No newline at end of file \ No newline at end of file
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