Skip to content

Commit

Permalink
Merge pull request #423 from collective/pfg-migration-fieldsets
Browse files Browse the repository at this point in the history
fix(ISSUE-279): 🐛 set fieldset description as attribute, not node, when migrating from PFG
  • Loading branch information
thet authored Mar 12, 2024
2 parents a1da7c1 + d46646c commit 2729175
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions news/279.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Set fieldset description as attribute, not node, when migrating from PFG.
[thomasmassmann]
9 changes: 8 additions & 1 deletion src/collective/easyform/migration/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ def append_or_set_title(field, name, value):
append_node(field, name, value)


def append_or_set_description(field, name, value):
if field.tag == 'fieldset':
set_attribute(field, 'description', value)
else:
append_node(field, name, value)


def convert_tales_expressions(value):
if value == u"here/memberEmail":
return u"python:member and member.getProperty('email', '') or ''"
Expand Down Expand Up @@ -174,7 +181,7 @@ def to_text(value):
}

PROPERTIES_MAPPING = {
"description": Property("description", append_node),
"description": Property("description", append_or_set_description),
"likertQuestions": Property("questions", append_list_node),
"likertAnswers": Property("answers", append_list_node),
"fgDefault": Property("default", append_default_node),
Expand Down

0 comments on commit 2729175

Please sign in to comment.