Ticket #1183 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

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

xmlformat-2nd-level.diff Download (10.2 KB) - added by dgollub 2 years ago.
xmlformat plugin patch to handle multiple levels in demerger
fix-xmlfield-firstchild-on-assembling.diff Download (478 bytes) - added by dgollub 2 years ago.
OpenSync? patch to fix the order in xmlfield, the first child got overwritten by the last child all the time

Change History

comment:1 Changed 2 years ago by henrik

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

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

xmlformat plugin patch to handle multiple levels in demerger

Changed 2 years ago by dgollub

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.

comment:4 Changed 2 years ago by dgollub

(In [5966]) Fix issue in osync_xmlfield_new_xmlfield() when the first child pointer get always overwritten. This requires that the previous pointer (in this case the last child in the siblings-list) get retrieved via a new function: osync_xmlfield_get_last_child()

see #1183

comment:5 Changed 2 years ago by dgollub

  • Status changed from assigned to closed
  • Resolution set to fixed

(In [5967]) Fixes demerger of second level xmlfields

fixes #1183

Note: See TracTickets for help on using tickets.