Version: unspecified (using KDE 4.7.4) OS: Linux The internal storage of VCARDS in Akonadi is incorrect regarding multiple CATEGORIES. Categories are stored in VCARD data like this: CATEGORIES:CatA\,CatB\,Cat C,D,E\,CatF whereas according to the RFC, they should be rather stored like that: CATEGORIES:CatA,CatB,Cat C\,D\,E,CatF Reproducible: Always Steps to Reproduce: Create a contact with multiple categories, sync via groupdav and watch VCARD sent or jut watch raw storage in Akonadi Console Actual Results: CATEGORIES will be joined together with "\," instaed of just "," Expected Results: CATEGORIES should be joined together just with "," and all "," WITHIN a categories should be escaped with "\,". This bug causes LOSS OF DATA , ie CATEGORIES and messes up the DAV server Reference: http://tools.ietf.org/html/rfc6350#section-4 http://tools.ietf.org/html/rfc6350#section-6.7.1 text = *TEXT-CHAR TEXT-CHAR = "\\" / "\," / "\n" / WSP / NON-ASCII / %x21-2B / %x2D-5B / %x5D-7E ; Backslashes, commas, and newlines must be encoded. text-list = text *("," text) CATEGORIES-value = text-list Example: CATEGORIES:INTERNET,IETF,INDUSTRY,INFORMATION TECHNOLOGY NOTE in the above that special chars WITHIN the category must be encoded, but the individual categories are joined together using plain ","
*** This bug has been confirmed by popular vote. ***
I am also experiencing this bug. Also exported vCard 3.0 files are broken. This bug can already be seen in Kontact from KDE 3.5.10 (with export to vCard, DAV was not supported at that time), so it seems to be a pretty old defect...
This is a bug in the underlaying iCal library. Anybody working on this one?
After upgrading to 4.8.3, the bug seems to be resolved.
Hei Ingo how did you have tested this? I have just installed 4.8.3 on my Kubuntu 12.4 then I created just a simple addressbook (as plain file) then I exported a dummy contact to as VCARD 3.0: ------------------------------------------ BEGIN:VCARD CATEGORIES:Friends\,Familie FN:Blabla N:Blabla;;;; UID:z3HxtI38VK VERSION:3.0 END:VCARD ------------------------------------------- thus, the group seperator is still wrong for me: \, Using the GroupDAV connector with SabreDAV is doing the same, but testing with the vcf3.0 export is a faster check Andreas
Hmm, strange. I did a sync via CardDAV using the groupdav resource and traced conversation using WireShark. And all was fine, only commas ",", without the backslashes "\,"... So sync was perfect. Is the akonadi groupdav resource maybe changing the encoding before it sends it? And KAddressbook is using the original iCal library to export? Remember the export is not done by Akonadi or it's resources...
Sorry, my wrong. KOrganiser does sync calendar CATEGORIES now correctly, but KAddressbook is still doing it wrong. And it still does not sync or export FBURL. Strange bug. It stores it incorrectly in Akonadi, so I guess it's not a bug in KAddressbook but in one of the underlaying libs. One of the bugs in KAddressbook re birthday display has recently been resolved. I'll dig a bit in the git repos to find the origin.
vcardtool assumes that categories are stored in a QStringList: creating VCard data 142 if ( version == VCard::v3_0 ) { 143 QStringList categories = (*addrIt).categories(); 144 QStringList::Iterator catIt; 145 for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { 146 (*catIt).replace( QLatin1Char( ',' ), QLatin1String( "\\," ) ); 147 } 148 149 VCardLine catLine( QLatin1String( "CATEGORIES" ), categories.join( QLatin1String( "," ) ) ); 150 card.addLine( catLine ); 151 } The code seems to be okay. It replaces all commas within each string (category) with '\,' which is correct. It then joins it all together using plain ','. This is according to RFC parsing VCard Data 364 static const QLatin1Char commaSep( ',' ); 428 else if ( identifier == QLatin1String( "categories" ) ) { 429 const QStringList categories = splitString( commaSep, (*lineIt).value().toString() ); 430 addr.setCategories( categories ); 431 } Addr is apparently defined in kabc/addressee.cpp, however I cannot find that file!!! ===================== ASSUMPTION: KAddressbook or underlaying packages are not using QStringlist but store one single CATEGORIES string in QStringlist, hence all commas within are replaced. Does that make sense to anyone?
Hard to believe that nobody else is bothered by this bug and that no one seems to put any effort into fixing it. Is anybody reading this out there? If the source code would be better documented or I could actually FIND the files, I could hunt for myself! Disappointing really!
I agree! thanks so far... Andreas Am Dienstag, 26. Juni 2012, 19.11:13 schrieben Sie: > https://bugs.kde.org/show_bug.cgi?id=293098 > > --- Comment #9 from Ingo Ratsdorf <ingo@envirology.co.nz> --- > Hard to believe that nobody else is bothered by this bug and that no one > seems to put any effort into fixing it. > Is anybody reading this out there? > > If the source code would be better documented or I could actually FIND the > files, I could hunt for myself! > > Disappointing really!
I confirm it. Will look at how to fix it.
Git commit 51a474722ee0d5b96e2e5593978bc5be3deef516 by Montel Laurent. Committed on 29/06/2012 at 10:22. Pushed by mlaurent into branch 'master'. Fix Bug 293098 - KAddressbook/Akonadi stores CATEGORIES escaped the wrong way It was already escaped when we create category Not necessary to re-escapte it. FIXED-IN: 4.8.5 M +4 -4 kabc/vcardparser/vcardparser.cpp http://commits.kde.org/kdepimlibs/51a474722ee0d5b96e2e5593978bc5be3deef516
Git commit e2fe3f314d5ab5665e87e6e9b5b8ba268ada90f9 by Montel Laurent. Committed on 29/06/2012 at 10:22. Pushed by mlaurent into branch 'KDE/4.8'. Fix Bug 293098 - KAddressbook/Akonadi stores CATEGORIES escaped the wrong way It was already escaped when we create category Not necessary to re-escapte it. FIXED-IN: 4.8.5 (cherry picked from commit 51a474722ee0d5b96e2e5593978bc5be3deef516) M +4 -4 kabc/vcardparser/vcardparser.cpp http://commits.kde.org/kdepimlibs/e2fe3f314d5ab5665e87e6e9b5b8ba268ada90f9
Git commit 688dc4c1c61cfc90308c25c4b5e9213d3263c8f4 by Montel Laurent. Committed on 29/06/2012 at 10:22. Pushed by mlaurent into branch 'KDE/4.9'. Fix Bug 293098 - KAddressbook/Akonadi stores CATEGORIES escaped the wrong way It was already escaped when we create category Not necessary to re-escapte it. FIXED-IN: 4.8.5 (cherry picked from commit 51a474722ee0d5b96e2e5593978bc5be3deef516) M +4 -4 kabc/vcardparser/vcardparser.cpp http://commits.kde.org/kdepimlibs/688dc4c1c61cfc90308c25c4b5e9213d3263c8f4
Supercool! If that solved the issue, that would be fantastic. Thanks!
For me it's ok now. Please test it:)