Commit 999838b8 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Try getProperty only if hasProperty succeeds. Pass form_id to...

Try getProperty only if hasProperty succeeds. Pass form_id to portal_selections/setSelectionQuickSortOrder.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8204 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7603bb3f
......@@ -1788,9 +1788,13 @@ class ListBoxRendererLine:
original_value = getattr(obj, property_id, None)
processed_value = original_value
if not callable(original_value):
original_value = obj.getProperty(property_id)
processed_value = original_value
if not callable(original_value) and obj.hasProperty(property_id):
try:
original_value = obj.getProperty(property_id)
processed_value = original_value
except AttributeError:
original_value = getattr(obj, property_id)
processed_value = original_value
except (AttributeError, KeyError):
original_value = None
processed_value = 'Could not evaluate %s' % property_id
......@@ -2330,8 +2334,8 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
""")
if sql is not None:
html_list.append("""\
<a href="portal_selections/setSelectionQuickSortOrder?selection_name=%s&sort_on=%s">%s</a>\
""" % (self.getSelectionName(), sql, unicode(Message(domain = ui_domain, message = title))))
<a href="portal_selections/setSelectionQuickSortOrder?selection_name=%s&amp;sort_on=%s&amp;form_id=%s">%s</a>\
""" % (self.getSelectionName(), sql, self.getForm().id, unicode(Message(domain = ui_domain, message = title))))
if sort_order == 'ascending':
html_list.append("""\
......
......@@ -206,8 +206,8 @@
title python: value[1];
sort_order python: value[2]">
<td tal:condition="sql" class="Data">
<a href="portal_selections/setSelectionQuickSortOrder?selection_name=default&amp;sort_on=id"
tal:attributes="href string:portal_selections/setSelectionQuickSortOrder?selection_name=${selection_name}&amp;sort_on=${sql}"
<a href="portal_selections/setSelectionQuickSortOrder?selection_name=default&amp;sort_on=id&amp;form_id=view"
tal:attributes="href string:portal_selections/setSelectionQuickSortOrder?selection_name=${selection_name}&amp;sort_on=${sql}&amp;form_id=${form_id}"
tal:content="title" i18n:domain="ui" i18n:translate="">ID</a>
<img tal:condition="python: sort_order == 'ascending'"
src="1bottomarrow.png" alt="Ascending Display" title="Ascending Display"
......
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