GNOME Bugzilla – Bug 332136
Evolution fails to import contacts from a file into an addressbook if the addressbook is never opened
Last modified: 2013-09-13 00:55:55 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.
*** This bug has been marked as a duplicate of 322689 ***
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.
Created attachment 60467 [details] [review] patch Moving the permission after e_book_open().
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).
Created attachment 60557 [details] [review] Updated patch
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.
Created attachment 60630 [details] [review] patch Sush, moving e_book_open() and writable check before. How about it?
Fix committed to cvs head.
Devashish, thanks.