After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 332136 - Evolution fails to import contacts from a file into an addressbook if the addressbook is never opened
Evolution fails to import contacts from a file into an addressbook if the add...
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Contacts
2.6.x
Other All
: Normal major
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2006-02-22 07:20 UTC by Irene Huang
Modified: 2013-09-13 00:55 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
patch (3.00 KB, patch)
2006-03-02 08:44 UTC, Xiurong Simon Zheng
needs-work Details | Review
Updated patch (3.25 KB, patch)
2006-03-03 12:10 UTC, Xiurong Simon Zheng
needs-work Details | Review
patch (3.63 KB, patch)
2006-03-04 11:56 UTC, Xiurong Simon Zheng
none Details | Review

Description Irene Huang 2006-02-22 07:20:59 UTC
Please describe the problem:
Evolution fails to import contacts from a file into an addressbook if the
addressbook is never opened 

Steps to reproduce:
1. run Evolution
2. click contact button to show contacts view
3. create a new addressbook and don't choose it.
4. import contacts from a file (.vcf for example) to the never-opened addressbook



Actual results:
The contacts are not imported, and a warning message is shown in the terminal
saying that: "Evolution-Importer-Message: evolution-vcard-importer.c:485:Book is
readonly."

Expected results:
All contacts in the file should be sucessfully imported to the chosen addressbook

Does this happen every time?
Yes

Other information:
This happens on Solaris sometimes even if the addressbook where the contacts are
to be imported to was accessed.
Comment 1 André Klapper 2006-02-22 10:22:43 UTC

*** This bug has been marked as a duplicate of 322689 ***
Comment 2 Irene Huang 2006-02-22 11:07:16 UTC
Actually, the problem I describe here is different from that of 322689. 
We don't have to create a new addressbook to reproduce this bug.
Simply don't access that addressbook after evolution is started, you won't be able to import the files. The warning messege will be shown at the first attempt to import contact, but the operation sucesses after the first try. 

However, I reckon contacts should be imported at the first time.
Comment 3 Xiurong Simon Zheng 2006-03-02 08:44:37 UTC
Created attachment 60467 [details] [review]
patch

Moving the permission after e_book_open().
Comment 4 Sushma Rai 2006-03-03 08:44:42 UTC
Please use "gci->book" instead of "book" in e_book_is_writable() call,
for the consistency sake, as we assign book to gci->book before that.

Also if book is not writable, free the file contents read before 
returning (in case of vcf).
Comment 5 Xiurong Simon Zheng 2006-03-03 12:10:38 UTC
Created attachment 60557 [details] [review]
Updated patch
Comment 6 Sushma Rai 2006-03-04 11:26:13 UTC
In case book is not writable, gci and it's contents needs to be freed.
or you can try for book_open() and e_book_is_writable() check, before
initializing gci.
Comment 7 Xiurong Simon Zheng 2006-03-04 11:56:38 UTC
Created attachment 60630 [details] [review]
patch

Sush, moving e_book_open() and writable check before. How about it?
Comment 8 Devashish Sharma 2006-03-06 10:13:10 UTC
Fix committed to cvs head.
Comment 9 Xiurong Simon Zheng 2006-03-06 10:30:57 UTC
Devashish, thanks.