Roundcube-CardDAV icon indicating copy to clipboard operation
Roundcube-CardDAV copied to clipboard

Adding new contacts SabreDAV

Open e-dschungel opened this issue 13 years ago • 6 comments

When I try to add a new contact using the Roundcube UI I get the error "An error occurred while saving." after clicking the save button. No new entry is generated on the Carddav server.

CardDAV Server: SabreDAV 1.6.4 or 1.7.1 (I tested both) RC: 0.8.2

e-dschungel avatar Oct 26 '12 16:10 e-dschungel

SabreDAV 1.6.4 works now. I had an error in my apache configuration. It was blocking PUT requests.

SabreDAV 1.7.1 doesn't work. I did a little debugging and found out that SabreDAV throws an execption because the vcard the cardDAV plugin tries to send does not contain an UID. This is required by the standard. The UID validation came in with this commit: https://github.com/evert/SabreDAV/commit/4e11b8e531401416bfe9a30f7119625a65f8f143

This issue was fixed in the myroundcube fork, see http://myroundcube-plugins.40634.n3.nabble.com/cardDAV-Adding-new-contacts-using-SabreDAV-td4024337.html

e-dschungel avatar Nov 02 '12 15:11 e-dschungel

This issue also kills "add new contact" for a baikal server (based on sabreDAV). I can confirm that the carddav_backend.php from the latest myroundcube fork fixed this for baikal too. I think someone should attempt to include the fix here.

mrpurplenz avatar Dec 04 '12 19:12 mrpurplenz

This error occurs in all SabreDAV based caldav and carddav servers up to SabreDAV versions 1.6.3-stable (2012-06-12): https://github.com/evert/SabreDAV/blob/1.6/ChangeLog Line:35

ghost avatar Jan 07 '13 17:01 ghost

Hello! I have the same bug! I can do to fix it? Thank!

tuxgasy avatar Apr 23 '13 04:04 tuxgasy

As I understand the code a newly generated card does include an UID. However, and that is not the problem of this RC plugin, generating the UUID outside of the carddav server is wrong. The card should be send to the server without an UID using a POST request - not PUT (PUT is for updating a ressource, not creating it). The server itself should then generate that UID, create the record with that UID and send the UID back to the caller.

Now, I use plugin version 0.5.2 with RC 0.9.2 and I still can't create new cards... Sometimes I can't even update a card due to the same error message. If I would find some time to debug this I probably find the reason why this happens ;)

tfl avatar Jun 28 '13 09:06 tfl

I added a pull request which adds the missing UID to the vcard right before it is uploaded to the server. If you use postgres (as I do) you may probably would like to update your round cube's "config/db.inc.php" reflecting the name of your carddav_contacts sequence

$rcmail_config['db_sequence_carddav_contacts'] = 'carddav_contacts_carddav_contact_id_seq';

As long as I ignored that the vcard was uploaded but RC still reports an error. Now the error is gone but I now have a blank region where the new vcard data should be displayed. In both cases, after reloading the page the contact shows up ;)

tfl avatar Jun 29 '13 16:06 tfl