Opened 18 years ago
Closed 18 years ago
#2650 closed defect (invalid)
XML Serialization of None TextFields does not use the <None/> tag
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There appears to be a problem serializing TextFields where the value is None.
Refer to line 62 of xml_serializer.py
The expected return value from self.get_string_value(obj, field) is either a string or None however the get_string_value method does not appear to return None when appropriate.
The result of this oversight is that TextFields where the value is None is encoded as
<field type="TextField" name="comment">None</field>
rather than
<field type="TextField" name="comment"> <None/> </field>
Attachments (2)
Change History (5)
by , 18 years ago
comment:1 by , 18 years ago
Summary: | XML Serialization of None TextFields does not use the <None/> tag → [patch] XML Serialization of None TextFields does not use the <None/> tag |
---|
by , 18 years ago
Attachment: | xml_serializer.py added |
---|
Modification to the XML serializer to correctly encode the tag
comment:2 by , 18 years ago
Summary: | [patch] XML Serialization of None TextFields does not use the <None/> tag → XML Serialization of None TextFields does not use the <None/> tag |
---|
Please attach a patch against the current source, rather than the whole files. It is very difficult to work out what places you made changes to in both these files.
From what I can work out from your changes, I'm not sure it is correct. Can you please attach a test case showing that we deserialize the object correctly after making the change you propose. There might be a change needed in deserialization as well.
Removing the patch keyword for now until there is a real patch available.
comment:3 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
A potential patch