Bug 207078 - Importing Contacts detail from a spreadsheet (.csv) does not import birthdays and anniversaries.
Summary: Importing Contacts detail from a spreadsheet (.csv) does not import birthdays...
Status: VERIFIED FIXED
Alias: None
Product: kaddressbook
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-11 13:46 UTC by Sabine Faure
Modified: 2009-10-30 06:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
CSV import dialogue snapshot (57.95 KB, image/png)
2009-09-16 22:02 UTC, Sabine Faure
Details
Spreadsheet that I used to test this bug. (698 bytes, text/plain)
2009-09-16 22:04 UTC, Sabine Faure
Details
.csv file ISO date format (698 bytes, text/plain)
2009-10-28 22:03 UTC, Sabine Faure
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sabine Faure 2009-09-11 13:46:14 UTC
Version:            (using Devel)
Compiler:          gcc 4.3.2 
OS:                Linux
Installed from:    Compiled sources

- Create 3 contacts (with birthdays and Anniversaries in them) in a spreadsheet.
- Save them as a .csv file
- Configure Akonadi with an IMAP and Kolab resource.
- Launch Kaddressbook.
- Go to File menu/Import/Import CSV file...
- Browse to enter the .csv file in 'File to import'
- Change the 'Undefined' headings in proper headings (especially the 'birthday' and 'anniversary' heading)

The 'anniversary' field is not in the preselected list of column headings so I am guessing that a .csv file does not allow their import. If try anyway and leave the 'Anniversary' column as 'Undefined' then it is not imported at all.

- Click on 'Ok'
- Select an Address Book to import the Contact into

The Contacts are imported in the specified address book but eventhough the 'birthday' field was in the 'CSV import' dialogue it has not been imported at all.


Trunk, Svn Rev 1021831
Comment 1 Sabine Faure 2009-09-11 13:48:29 UTC
Sorry wrong revision number, this bug was in fact, tested with:

Trunk, Svn Rev 1022237
Comment 2 Tobias Koenig 2009-09-15 14:17:49 UTC
SVN commit 1023859 by tokoe:

Parse a complete QDateTime object as we export time
information as well.

BUG: 207078


 M  +6 -2      csvimportdialog.cpp  
 M  +28 -10    dateparser.cpp  
 M  +9 -5      dateparser.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1023859
Comment 3 Sabine Faure 2009-09-16 21:49:35 UTC
This does not work, neither the Birthday nor the Anniversary are imported.

The Anniversary field is still missing from the column headings list in the 'CSV Import' dialogue.

I am reopening this bug since I do not see any change in the display or in the imported contact.

Trunk, Svn Rev 1024362
Comment 4 Sabine Faure 2009-09-16 22:02:59 UTC
Created attachment 37001 [details]
CSV import dialogue snapshot
Comment 5 Sabine Faure 2009-09-16 22:04:49 UTC
Created attachment 37002 [details]
Spreadsheet that I used to test this bug.
Comment 6 Tobias Koenig 2009-09-17 09:05:41 UTC
Hej Sabine,

well, since your CSV file does use a different date format then the default
ISO format, you have to adapt the date pattern in the CSV import dialog as well,
otherwise KAddressBook has no chance to know how to interprete the date.
In your case the pattern should should be: D/M/Y

As you mentioned already, the Anniversary field is not supposed to be imported,
therefor it is not listed in the selection... maybe I'll add it later.

Ciao,
Tobias
Comment 7 Tobias Koenig 2009-09-29 18:34:58 UTC
SVN commit 1029398 by tokoe:

Include 'Anniversary' property into ContactFields

BUG: 207078


 M  +6 -0      contactfields.cpp  
 M  +1 -0      contactfields.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1029398
Comment 8 Sabine Faure 2009-09-30 22:04:08 UTC
This does not work.

There seems to be a huge regression since I cannot import even a simple spreadsheet into KDAB.

I am reopening this bug and I will report new specific ones about the importing .CSV files feature.

Trunk, Svn Rev 1029738
Comment 9 Sabine Faure 2009-10-01 20:34:08 UTC
I retested this today using the right date format (D/M/YTH:I:S) so that it would match my .csv data.

The Anniversary field that you added works fine however for some reason the birthday field gets lost during the import again:

The Contacts are imported in the specified address book but eventhough the
'birthday' field was in the 'CSV import' dialogue it has not been imported at
all.

Trunk, Svn Rev 1030016
Comment 10 Tobias Koenig 2009-10-03 12:18:25 UTC
Hej Sabine,

I just tested with the .csv file you attached to this bug report and
both, birthday and anniversary have been imported correctly (appeared in
the details view on the right side when selecting the imported contact).

Ciao,
Tobias
Comment 11 Sabine Faure 2009-10-09 01:15:41 UTC
I retested this today and it works.

I realized what was wrong and why this did not work for me before:
I was using the following format D/M/YTH:I:S when in fact I should have used D/M/Y to match my .csv file data.

I thought that the time format (TH:I:S) would be ignored in the case of birthdays and anniversaries since they do not make a lot of sense there. I doubt that any user would bother to enter hours for birthdays and anniversaries.
And there are no other entries from the headings list that would require them either.

So would it be possible to remove the time format from the 'CSV Import' dialogue to avoid the pb?

Trunk, Svn Rev 1032841
Comment 12 Tobias Koenig 2009-10-26 17:44:54 UTC
SVN commit 1040669 by tokoe:

Do not use the time information in the CSV import/export dialog

BUG: 207078


 M  +11 -1     csv_xxport.cpp  
 M  +2 -1      csvimportdialog.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1040669
Comment 13 Sabine Faure 2009-10-28 21:42:30 UTC
The time format has been removed from the Date format line edit.

And if you use the following .csv file with the ISO norm for the dates it nearly works:

The birthdays and anniversaries are imported for the first two contacts but only the birthday is imported for the last one (Jerome Silence) for some reason.
So I am reopening this bug.


Trunk, Svn Rev 1041831
Comment 14 Sabine Faure 2009-10-28 22:03:13 UTC
Created attachment 37937 [details]
.csv file ISO date format

See above.
Comment 15 Tobias Koenig 2009-10-29 11:10:05 UTC
Hej Sabine,

that's really a nice bug ;)
Take a closer look at the month component of the anniversary date
of Jerome Silence, it is 2005-O9-05... however it should be 2005-09-05 ;)
It took me one hour to spot that 'O' (uppercase 'o') is used here instead
of 0 (zero). Of course that's an invalid date and therefore the anniversary
is not imported :)

Ciao,
Tobias
Comment 16 Sabine Faure 2009-10-30 06:17:04 UTC
Oops, that is a very good point !
Sorry about that Tobias. I get a pointy hat for the day ;o)

The good news is that this works so I can close this bug now.

Birthdays and Anniversaries are imported correctly from a .csv file.

Trunk, Svn Rev 1042371