Commit b635c76a authored by Kevin Deldycke's avatar Kevin Deldycke

Fix bug "Entering an editable field in listbox redirects to the url_method of this field" (#416).

Don't include error_message tag if no error.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8689 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 03de5d3b
...@@ -1835,6 +1835,7 @@ class ListBoxRendererLine: ...@@ -1835,6 +1835,7 @@ class ListBoxRendererLine:
else: else:
processed_value = unicode(str(processed_value), self.renderer.getEncoding()) processed_value = unicode(str(processed_value), self.renderer.getEncoding())
LOG(sql, 0, str((obj.getPath(),original_value, type(original_value))))
value_list.append((original_value, processed_value)) value_list.append((original_value, processed_value))
return value_list return value_list
...@@ -1967,8 +1968,12 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine): ...@@ -1967,8 +1968,12 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
if url is None: if url is None:
html = cell_html + error_message html = cell_html + error_message
else: else:
html = u'<a href="%s">%s</a> <span class="warning">%s</span>' % (url, cell_html, error_message) if editable_field.get_value('editable'):
html = u'%s' % cell_html
else:
html = u'<a href="%s">%s</a>' % (url, cell_html)
if error_message not in ('', None):
html += u' <span class="warning">%s</span>' % error_message
else: else:
# If not editable, show a static text with a link, if enabled. # If not editable, show a static text with a link, if enabled.
processed_value = cgi.escape(processed_value) processed_value = cgi.escape(processed_value)
......
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