Ticket #1183 (closed defect: fixed)
demerge_xmlformat does not demerge second level
| Reported by: | henrik | Owned by: | dgollub |
|---|---|---|---|
| Priority: | highest | Milestone: | Plugin Format: XMLFormat 0.40 |
| Component: | Format Plugin: xmlformat | Version: | 0.39 |
| Severity: | blocker | Keywords: | |
| Cc: |
Description
The function demerge_xmlformat in xmlformat_merge.c is supposed to remove the fields in the xml format which are not defined in the capabilities.
This seems to work fine on the top level, if we have a <Name> in the xmlformat, but not in the capabilities, osync_xmlfield_delete gets called.
However, on the second level, if we have a <LastName?> inside a <Name> in the xmlformat, but not in the capabilities, the field is *not* deleted, instead the value of the field is set to blank.
This breaks the logic in xmlformat_compare, which will "Run out of list2 elements".
Also, demerge_xmlformat does not demerge parameters (only children).
See also the mailing list: http://old.nabble.com/demerge_xmlformat-does-not-demerge-second-level-ts25996320.html
Attachments
Change History
comment:2 Changed 2 years ago by dgollub
- Status changed from new to assigned
- Component changed from OpenSync: Format Conversion to Format Plugin: xmlformat
- Milestone changed from OpenSync 0.40 to XMLFormat Plugin 0.40
Changed 2 years ago by dgollub
-
attachment
xmlformat-2nd-level.diff
added
xmlformat plugin patch to handle multiple levels in demerger
Changed 2 years ago by dgollub
-
attachment
fix-xmlfield-firstchild-on-assembling.diff
added
OpenSync? patch to fix the order in xmlfield, the first child got overwritten by the last child all the time
comment:3 Changed 2 years ago by dgollub
Please try both attachted patches. Those are not yet final since the OpenSync related fix breaks one testcase. The other one depends on the OpenSync? fix and requires more closer review.

Since this is a major problem when trying to sync a phone and Thunderbird for the first time, I have also reported the bug here: https://sourceforge.net/tracker/?func=detail&aid=2891311&group_id=208811&atid=1007194