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 540274 - Evolution error in Contacts after restore from backup
Evolution error in Contacts after restore from backup
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Contacts
2.22.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Milan Crha
Evolution QA team
: 519767 525738 534812 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-06-26 08:28 UTC by Akhil Laddha
Modified: 2012-01-29 00:16 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
proposed evo patch (7.46 KB, patch)
2008-06-26 13:20 UTC, Milan Crha
committed Details | Review

Description Akhil Laddha 2008-06-26 08:28:54 UTC
Downstream bug https://bugzilla.novell.com/show_bug.cgi?id=402594

I have imported my mail from a backup file with Restore Settings. After that i
wanted to add a new contact but when i selected the contacts button i received
the following error:
Unable to open address book
We where unable to open this addressbook. Please check that the path
/home/gmathisz/.evolution/addressbook/local/system exists and you have
permission to access it.

The file that i find in that path is addressbook.db and my user has Read and
Write rights.
Comment 1 Milan Crha 2008-06-26 10:22:44 UTC
Is the /home/gmathisz/ prefix for the user same as on the new machine?

I can reproduce it only when changing the 'uri' key in the /apps/evolution/addressbook/sources, otherwise it works fine. As far as I can tell, the base_uri of the local group is configured as expected, only the 'uri' of the source isn't. Not all sources has the 'uri' attribute for me. Those without it works fine.
Comment 2 Milan Crha 2008-06-26 13:20:55 UTC
Created attachment 113460 [details] [review]
proposed evo patch

for evolution;

Fix in backup-restore plugin, the restore part only. This will try to fix the paths of local sources/accounts, if the user name where restored differs with the one where the backup was done.

please notice this comment in the code:
/* why does this return a 'const' object?!? */
I didn't find a proper way how to obtain "writeable" pointer from EAccountList.
Comment 3 Matthew Barnes 2008-06-26 14:57:18 UTC
The EIterator API is broken.  GObjects should never be marked constant.  I came across this in several places in the composer and overrode it with a cast, just like you did.
Comment 4 gmathisz 2008-06-26 20:27:23 UTC
The username/password on this machine is the same on both machines. How do i apply the patch to see if it works?
Comment 5 Milan Crha 2008-06-27 06:41:51 UTC
You can apply only if you compile from sources. But if your new machine's /home/user/ is exactly same as on that old one, then it should definitely work. Can you try to look on attributes in upper directories too? Maybe try to create file in the /home/gmathisz/.evolution/addressbook/local/system on console, whether it will work or not. It should, though. Can you paste here a content of /apps/evolution/addressbook/sources from gconf-editor please? Thanks.
Comment 6 Milan Crha 2008-06-27 14:35:59 UTC
*** Bug 534812 has been marked as a duplicate of this bug. ***
Comment 7 Srinivasa Ragavan 2008-06-30 08:34:56 UTC
(In reply to comment #3)
> The EIterator API is broken.  

You want to mark the patch for needs-work?
Comment 8 Matthew Barnes 2008-06-30 11:30:19 UTC
That statement wasn't directed at Milan's patch but at the EIterator API he had to use in writing the patch.  I was reassuring him that he did the right thing.

Beyond that, I haven't really reviewed his patch in detail.
Comment 9 Srinivasa Ragavan 2008-07-01 10:01:03 UTC
Milan, code seems fine. Just test and commit it. It should work much better now, from what I have started in 2.12.
Comment 10 Milan Crha 2008-07-01 10:32:06 UTC
Committed to trunk. Committed revision 35710.
Comment 11 B S Srinidhi 2008-07-01 18:48:31 UTC
This commit caused #541123 
Comment 12 B S Srinidhi 2008-07-01 19:26:18 UTC
Oops! A clean build fixed the problem. For some reason, plugins/backup-restore/Makefile didn't get generated correctly. 

Sorry about the noise. :( Moving the status back to Resolved.
Comment 13 Milan Crha 2008-11-24 12:49:29 UTC
*** Bug 525738 has been marked as a duplicate of this bug. ***
Comment 14 André Klapper 2012-01-29 00:16:42 UTC
*** Bug 519767 has been marked as a duplicate of this bug. ***