Skip to content

Commit

Permalink
fix incorrectly migrated list values
Browse files Browse the repository at this point in the history
context: list values  were added on 1 line in text widgets, which breaks some functionality
also don't ignore list default values
  • Loading branch information
ThibautBorn authored and gotcha committed Jan 13, 2025
1 parent 47f6857 commit 794e684
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/collective/easyform/migration/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def append_node(field, name, value):
name = "{{{}}}{}".format(ns, name)
node = etree.SubElement(field, name)
if isinstance(value, (list, tuple)):
value = u" ".join(value)
value = u"\n".join(value)
node.text = value
return node

Expand Down Expand Up @@ -97,8 +97,9 @@ def append_vocab_node(field, name, value):


def append_default_node(field, name, value):
if isinstance(value, list):
return
# commented out, as it is unclear why we wouldn't set default lists?
# if isinstance(value, list):
# return
if field.get("type") == "collective.easyform.fields.RichLabel":
append_node(field, "rich_label", value)
else:
Expand Down

0 comments on commit 794e684

Please sign in to comment.