-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing from .vcf file does not include the "note" #470
Comments
Hello, the vcard import is done by roundcube itself, not by this plugin. Could you please check the behavior when importing to roundcube’s builtin addressbook to confirm? |
Sure, thank you. This is my test .vcf file:
Import into "Personal addresses" in RoundCube: Import into CardDAV addressbook in RoundCube:
|
Thanks, I can reproduce it. For some reason, roundcube's vcard conversion yields the note as an array (with a single string member), where rcmcarddav expects a simple string value. $save_data = array (
'name' => 'Test Card',
'firstname' => 'Test',
'surname' => 'Test',
'middlename' => 'Test',
'prefix' => 'Test',
'phone:other' => array ( 0 => '1234', ),
'notes' => array ( 0 => 'Leitung erreichbar 8-13 Uhr, Mo+Fr zusätzlich 14-16 Uhr', ),
'email:other' => array ( 0 => '[email protected]', ),
'vcard' => 'BEGIN:VCARD
VERSION:3.0
FN:Test Card
N:Test;Test;Test;Test;
NOTE:Leitung erreichbar 8-13 Uhr, Mo+Fr zusätzlich 14-16 Uhr
EMAIL:[email protected]
TEL:1234
END:VCARD',
) There should also be an error message in carddav.log:
I am not sure whether my expectation is wrong or whether this is an issue of the roundcube vcard conversion, roundcube contacts anyway seems to be able to correctly process the result. More interestingly, however, we can see that roundcube passes along the original vcard as well. So I try to ignore the conversion result coming from roundcube in case a vcard is provided, and instead use sabre/vobject to parse and store the vcard to the CardDAV server mostly as is. This will result in a more consistent experience regarding interpretation of the vcard. |
Super. I however missed that log file, but sure enough - the error appear for both the "notes" and the "bday":
|
That should cover other properties as well, as long as the VCard is passed along.
Perhaps you can have two functions you call after what YOU want/expect. @mstilkerich : So I try to ignore the conversion result coming from roundcube in case a vcard is provided, and instead use sabre/vobject to parse and store the vcard to the CardDAV server mostly as is. This will result in a more consistent experience regarding interpretation of the vcard. |
I have pushed a fix to master. |
I tested it on my server, and it works with my test contact and several other contacts, with notes, that I exported from Kopano. Nice job, thank you. |
Bad news @mstilkerich, I have testet the fix, and found a unintentional bug.
When I perform a drag and drop operation with the version 5.1.0 copies of However when I perform the same drag and drop operation with the modified copies of Before drag and drop with version 1.5.0 files (just imported without notes :-( After drag and drop with version 1.5.0 files: Before drag and drop with modified files (just imported with notes :-) After drag and drop with modified files: The Dummy contact look like this:
|
I have a suggestion to a fix.
And in
Then I can both import and move contacts, with notes. And yes, I had to DuckDuckGo the |
…ks (#470) When a card is moved or copied from one CardDAV addressbook to another via the roundcube web interface, the Addressbook::insert() function will receive a save_data object produced by rcmcarddav's DataConversion class, which includes a dummy vcard, but also the original vcard object. With the recent change to use a vcard provided by roundcube upon the import action, this dummy vcard would wrongly be added to the target addressbook. To avoid this, use the original vcard object that is also included in the save_data when it has been produced by rcmcarddav.
Thanks for testing this, I have added a fix for the regression as well. |
I think it is working now. At first it did not work and I got an "Imported 0 contacts" in RoundCube. For the DuckDuckGo records, those were the sequel queries I executed on the MariaDB database, to delete a user in RoundCube mail (it deletes a user in the tables including your RCM CardDAV tables):
Note that the |
Ok, I‘ll close this then. The UID is supposed to be unique, so a carddav server should not accept two cards with the same UID. So what you see is intended behavior. The filename should not be an issue. Thanks again for reporting this issue and testing the fixes! |
RCM CardDAV does not import "note" from .vcf files.
I found this old thread, where the issue was fixed when saving contacts:
#124
Test A:
Test B:
Test C:
I have:
PS: I can edit the contact in RoundCube and add a note, but not import a contact with note.
The text was updated successfully, but these errors were encountered: