6.0.0-beta1
7/8/25

[#13706] syncML Calendar sync broken
Summary syncML Calendar sync broken
Queue Synchronization
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester horde (at) albasoft (dot) com
Created 11/20/2014 (3883 days ago)
Due
Updated 11/21/2014 (3882 days ago)
Assigned
Resolved 11/21/2014 (3882 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
11/21/2014 03:45:59 PM Jan Schneider Assigned to Jan Schneider
State ⇒ Resolved
 
11/21/2014 03:45:48 PM Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit aa85cbf7325a0b45673778863585b1eeac1bd262
Author: Jan Schneider <jan@horde.org>
Date:   Fri Nov 21 16:41:20 2014 +0100

     Check if the backend returned multiple IDs (horde@albasoft.com).

     Bug: 13706

     Some backends return multiple server IDs when adding single 
client IDs, because
     they either support adding multiple objects at once, or a single 
object results
     in multiple server-side object. This happens when adding an event with
     exceptions for example.

     It's still save to only log the first server ID, because we 
either take care of
     only passing a single object at once (case 1) or the parent 
server object's ID
     is returned first.

  .../SyncMl/lib/Horde/SyncMl/Backend/Horde.php      |    1 +
  framework/SyncMl/package.xml                       |    8 ++++----
  2 files changed, 5 insertions(+), 4 deletions(-)

http://github.com/horde/horde/commit/aa85cbf7325a0b45673778863585b1eeac1bd262
11/20/2014 11:42:51 AM horde (at) albasoft (dot) com New Attachment: hordewm5-syncml_CalImport.patch Download
 
11/20/2014 11:42:03 AM horde (at) albasoft (dot) com Comment #1
Priority ⇒ 2. Medium
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ Synchronization
Summary ⇒ syncML Calendar sync broken
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
I get this error when sending a new event from syncML Funambol client 
to Horde:

2014-11-20T11:02:56+01:00 ERR: HORDE Unable to find addition timestamp 
for server id Array at 0 [pid 7208 on line 322 of 
"Horde/SyncMl/Sync.php"]
2014-11-20T11:02:56+01:00 WARN: HORDE PHP ERROR: PDO::quote() expects 
parameter 1 to be string, array given [pid 7208 on line 308 of 
"Horde/Db/Adapter/Pdo/Base.php"]
2014-11-20T11:02:56+01:00 ERR: HORDE SQL QUERY FAILED: 
SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near ","
LINE 1: ...tner, syncml_db, syncml_uid, syncml_cuid) VALUES (, 0, 'fmz-...
                                                              ^
         INSERT INTO horde_syncml_map (syncml_suid, syncml_timestamp,
           syncml_syncpartner, syncml_db, syncml_uid, syncml_cuid) VALUES (, 0,
           'fmz-l6IH/XXXXXXXXXX==', 'calendar', 'xxxxx',
           'XXXXXXXXXXXXXXXXXXX') [pid 7208 on line 204 of 
"Horde/Db/Adapter/Pdo/Base.php"]

The new event is created at Horde database. But all sync is lost, and 
any editing will create a new event.

Searching into code, I've found that new events are added one by one 
to Horde backend using "import" from Kronolith/lib/Api.php.
That call returns an array of suid, while just a string is expected at 
"addEntry" in Horde/SyncMl/Backend/Horde.php.

The attached patch avoids that, because it never imports more than one 
element at a time, although I guess it has to be fixed somewhere else:
- All other "import" API calls return a string, but Kronolith and Nag.
- Nag "import" returns an array, or a string for a single element .
- Kronolith "import" returns an array.

Saved Queries