From 794e684706e2945e53502654abad674724e3ba01 Mon Sep 17 00:00:00 2001 From: Thibaut Born Date: Wed, 14 Feb 2024 16:26:09 +0100 Subject: [PATCH] fix incorrectly migrated list values context: list values were added on 1 line in text widgets, which breaks some functionality also don't ignore list default values --- src/collective/easyform/migration/fields.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/collective/easyform/migration/fields.py b/src/collective/easyform/migration/fields.py index 307df358..d38e0894 100644 --- a/src/collective/easyform/migration/fields.py +++ b/src/collective/easyform/migration/fields.py @@ -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 @@ -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: