Commit 7fd36c8f authored by Romain Courteaud's avatar Romain Courteaud

Bug fix: correct error in render when no cell exists.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2627 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d034509a
...@@ -291,12 +291,16 @@ class MatrixBoxWidget(Widget.Widget): ...@@ -291,12 +291,16 @@ class MatrixBoxWidget(Widget.Widget):
list_result_lines.append(attribute_value) list_result_lines.append(attribute_value)
else: else:
if my_field.get_value('hidden'):
attribute_value = my_field.get_value('default', cell_index = kw, cell_position = (i,j, k))
if render_format == 'html': if render_format == 'html':
# XXX no cell exists, we need to display a correct field, without generate plenty of errors... cell_body += str(my_field.render(value = attribute_value, REQUEST=REQUEST, key=key))
cell_body += str(my_field.render(value = None, REQUEST=REQUEST, key=key))
else:
if render_format == 'html':
cell_body += str(my_field.render(value = my_field.get_orig_value('default') , REQUEST=REQUEST, key=key))
elif render_format == 'list': elif render_format == 'list':
if not my_field.get_value('hidden'):
list_result_lines.append(None) list_result_lines.append(None)
list_body = list_body + \ list_body = list_body + \
...@@ -374,7 +378,9 @@ class MatrixBoxValidator(Validator.Validator): ...@@ -374,7 +378,9 @@ class MatrixBoxValidator(Validator.Validator):
kwd = {} kwd = {}
kwd['base_id'] = cell_base_id kwd['base_id'] = cell_base_id
cell = getter_method(*kw, **kwd) cell = getter_method(*kw, **kwd)
for attribute_id in editable_attribute_ids: for attribute_id in editable_attribute_ids:
my_field_id = '%s_%s' % (field.id, attribute_id) my_field_id = '%s_%s' % (field.id, attribute_id)
if form.has_field(my_field_id): if form.has_field(my_field_id):
my_field = form.get_field(my_field_id) my_field = form.get_field(my_field_id)
...@@ -383,10 +389,6 @@ class MatrixBoxValidator(Validator.Validator): ...@@ -383,10 +389,6 @@ class MatrixBoxValidator(Validator.Validator):
cell_position = (i,j, k)) cell_position = (i,j, k))
value = my_field.validator.validate(my_field, key, REQUEST) value = my_field.validator.validate(my_field, key, REQUEST)
# XXX Dirty patch, but it was hurry that membership_criterion_category_list field works to generate predicate
if attribute_id == 'membership_criterion_category_list':
value = attribute_value
if attribute_value != value and not my_field.get_value('hidden'): if attribute_value != value and not my_field.get_value('hidden'):
# Only validate modified values from visible fields # Only validate modified values from visible fields
if not result.has_key(kw): if not result.has_key(kw):
......
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