Commit bacffa92 authored by Jérome Perrin's avatar Jérome Perrin

Some fields, such as LabelFields does not have an "alternate_name" value. Use

field.has_value to check if the field supports alternate_name before getting
the value.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22582 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3e3fcbc1
...@@ -212,7 +212,9 @@ def parseField(f):\n ...@@ -212,7 +212,9 @@ def parseField(f):\n
Parse given form field, to put them in\n Parse given form field, to put them in\n
kw or in encapsulated_editor_list\n kw or in encapsulated_editor_list\n
"""\n """\n
k = f.get_value(\'alternate_name\') or f.id\n k = f.id\n
if f.has_value(\'alternate_name\'):\n
k = f.get_value(\'alternate_name\')\n
v = getattr(request, k, MARKER)\n v = getattr(request, k, MARKER)\n
if hasattr(v, \'edit\'):\n if hasattr(v, \'edit\'):\n
# This is an encapsulated editor\n # This is an encapsulated editor\n
...@@ -408,6 +410,12 @@ return result\n ...@@ -408,6 +410,12 @@ return result\n
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Base_edit</string> </value> <value> <string>Base_edit</string> </value>
</item> </item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
<value> <value>
......
907 908
\ No newline at end of file \ No newline at end of file
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