One of my customers did an Outlook export / Roundcube import of his contacts, and none of the contacts were displaying their email address in the address book's vcard section.
In the database, all of his contacts had been saved with, "EMAIL;TYPE=INTERNET;TYPE=MAIN:address@host.com". My contacts for example are, "EMAIL;TYPE=INTERNET;TYPE=OTHER:address@host.com". Changing TYPE=OTHER to TYPE=MAIN in one of my contacts caused that one to also not display correctly.
I traced this back to program/steps/addressbook/func.inc:
29c29 < 'email' => array('type' => 'text', 'size' => 40, 'maxlength' => 254, 'label' => rcube_label('email'), 'subtypes' => array('home','work','other'), 'category' => 'main'),
'email' => array('type' => 'text', 'size' => 40, 'maxlength' => 254, 'label' => rcube_label('email'), 'subtypes' => array('home','work','other','main'), 'category' => 'main'),
...but I'm not sure if this is generally desired behavior or not, so I'm posting here for discussion instead of trac.
Thanks,
On 08/26/2013 12:06 AM, Rob Sheldon wrote:
'email' => array('type' => 'text', 'size' => 40, 'maxlength' => 254, 'label' => rcube_label('email'), 'subtypes' => array('home','work','other','main'), 'category' => 'main'),
...but I'm not sure if this is generally desired behavior or not, so I'm posting here for discussion instead of trac.
We have a ticket for this issue, but I think the change is not as simple as that. http://trac.roundcube.net/ticket/1489083
On 2013-08-25 23:16, A.L.E.C wrote:
On 08/26/2013 12:06 AM, Rob Sheldon wrote:
'email' => array('type' => 'text', 'size' => 40, 'maxlength' => 254, 'label' => rcube_label('email'), 'subtypes' => array('home','work','other','main'), 'category' => 'main'),
...but I'm not sure if this is generally desired behavior or not, so I'm posting here for discussion instead of trac.
We have a ticket for this issue, but I think the change is not as simple as that. http://trac.roundcube.net/ticket/1489083
Hmm. I'm not personally familiar with the vcard format, so I'm not sure how much help I'll be here.
Let me get ahold of the customer's export file and see if there's a "preferred" type in there. If there isn't, then I don't yet understand how this is the same bug. If there is, I'll see what I can do to help.
[__ Robert Sheldon [__ No Problem [__ Information technology support and services [__ (530) 575-0278
On 08/26/2013 08:44 AM, Rob Sheldon wrote:
Hmm. I'm not personally familiar with the vcard format, so I'm not sure how much help I'll be here.
Let me get ahold of the customer's export file and see if there's a "preferred" type in there. If there isn't, then I don't yet understand how this is the same bug. If there is, I'll see what I can do to help.
Right, not the same (now I see). However, very similar. MAIN could be handled as alias for PREF, I suppose. Feel free to put a comment in the ticket. None of vCard format versions specify TYPE=MAIN, however any type is possible.
On 2013-08-26 0:20, A.L.E.C wrote:
Right, not the same (now I see). However, very similar. MAIN could be handled as alias for PREF, I suppose. Feel free to put a comment in the ticket. None of vCard format versions specify TYPE=MAIN, however any type is possible.
I am having an embarrassing issue with trac: my email address (rob@associatedtechs.com) seems to already be tied to a trac account, but my trac login isn't in my password manager and I can't find any way to send a reset to that email account. ...
Moving on to less silly stuff: so, plot thickens on the address book import. Got the file from my customer, and it was a CSV file, not a vcf. So the "main" type is being set by the Roundcube import code somewhere. Also, only about 35% of his contacts were successfully imported even though (with a little bit of help) LibreOffice is able to read all of the rows in the file.
I'm going to dig into this. If it's an input file parsing issue (the formatting on the file is pretty icky), it just so happens that my favorite thing in programming is writing efficient & robust parsers.
So two questions: 1. Should I update to 0.9.3 first? And 2. Anything in particular I should know about before tackling this? I'm not very familiar with the RoundCube codebase.
Thanks,
[__ Robert Sheldon [__ No Problem [__ Information technology support and services [__ (530) 575-0278
I finally got a chance to look further into this.
The contacts import process has a few problems when dealing with CSV files. CSV files can contain line breaks in a "Notes" field for a contact, but import() in /program/lib/Roundcube/rcube_csv2vcard.php splits on line breaks and then attempts to parse each line individually. As a result, the first contact that contains a line break in the CSV file causes subsequent contacts to be skipped up until the stars are in alignment several contacts further down the file.
Also, explode_quoted_string() in /program/lib/Roundcube/rcube_utils.php doesn't seem to do proper range checking for strings beginning with a ". It's making PHP complain, but doesn't seem to be affecting the output.
The "type=main" issue I originally reported is caused by an entry at the top of rcube_csv2vcard.php, where field mappings are listed. There are a couple of TODO notes next to several field mappings, including the second and third email addresses -- which is why the type setup is a little bit screwy.
So, CSV contacts import from Office 2010 is pretty icky. Most imported contacts should be expected to be missing data.
If you guys are cool with me chewing on this, then: I'll update to 0.9.3; double-check the field mappings against Office 2010 UI; re-factor the CSV file parsing code to treat it as a stream and maintain quoted state and all that good stuff; set up a Github account; do a pull request, which I've never done before, so probably I'll be a little bit of a pain in the ass.
Is that all copacetic?
[__ Robert Sheldon [__ No Problem [__ Information technology support and services [__ (530) 575-0278
On 08/30/2013 11:37 AM, Rob Sheldon wrote:
If you guys are cool with me chewing on this, then: I'll update to 0.9.3; double-check the field mappings against Office 2010 UI; re-factor the CSV file parsing code to treat it as a stream and maintain quoted state and all that good stuff; set up a Github account; do a pull request, which I've never done before, so probably I'll be a little bit of a pain in the ass.
Yes, please. Use git-master code as a base for changes. Would be perfect if you could also add some tests with real export files. There are already some simple tests in tests/Framework/Csv2vcard.php.
On 2013-08-30 2:44, A.L.E.C wrote:
Yes, please. Use git-master code as a base for changes. Would be perfect if you could also add some tests with real export files. There are already some simple tests in tests/Framework/Csv2vcard.php.
OK. I can't use my customer's export file for that -- privacy & all -- but I'll come up with something.
[__ Robert Sheldon [__ No Problem [__ Information technology support and services [__ (530) 575-0278