Skip to content

Commit

Permalink
fix(ISSUE-279): 🐛 set fieldset description as attribute, not node, wh…
Browse files Browse the repository at this point in the history
…en migrating from PFG
  • Loading branch information
thomasmassmann committed Jun 11, 2021
1 parent ce31ba0 commit 1cae079
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
@@ -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
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 @@ -171,7 +178,7 @@ def to_text(value):
}

PROPERTIES_MAPPING = {
'description': Property('description', append_node),
'description': Property('description', append_or_set_description),
'fgDefault': Property('default', append_default_node),
'fgmaxlength': Property('max_length', append_maxlength_node),
'fgsize': None, # Not available in collective.easyform
Expand Down

0 comments on commit 1cae079

Please sign in to comment.