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 547223 - e_contact_set_property will overwrite "business phone" when setting "other phone"
e_contact_set_property will overwrite "business phone" when setting "other ph...
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
unspecified
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
: 502758 532520 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-08-10 23:59 UTC by Matt Davey
Modified: 2009-07-29 04:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix treatment of 'other' phone records (769 bytes, patch)
2008-08-13 22:10 UTC, Matt Davey
committed Details | Review

Description Matt Davey 2008-08-10 23:59:29 UTC
If you have a business-phone, and then you set a "other-phone", using e-contact-set(), it overwrites the business-phone, for example.

As far as I can see, the problem is that the 'other phone' has a single
attribute "VOICE" and the 'work phone' (for example) has "VOICE" and "WORK". 
When e_contact_set_property tries to set the "other phone" property, it looks
through the existing attributes and looks for "VOICE" and successfully makes a
match on "VOICE,WORK".

See, for example, e-contact.c lines 142, 153, and 821-887 (revision 9011).

I think there are several user-visible bugs that are caused by the inability of the e-contact code to properly separate the 'other' phone and fax from 'business' and 'personal' versions...

Note: I suspect this is related to #502758 and #532520
Comment 1 Matt Davey 2008-08-13 22:10:51 UTC
Created attachment 116533 [details] [review]
fix treatment of 'other' phone records

This patch needs to be reviewed to ensure it doesn't have any unforeseen side effects, but it does improve behaviour for me.  For example, I no longer have 'other' and 'work' phone numbers appearing in the summary addressbook screen when I've only got a 'work' number.  i.e. this appears to fix bug 502758.

The patch changes the logic for mapping the attributes to contact fields: if an attribute type has only one field (e.g. for 'other phone' the 'TYPE' parameter has a single field "VOICE"), then we should FAIL to match if the 'TYPE' parameter contains any other fields.  This prevents "TYPE=VOICE;" from matching (and overwriting) "TYPE=VOICE,WORK;".
Comment 2 Srinivasa Ragavan 2008-08-18 03:20:36 UTC
Milan, can you review this?
Comment 3 Milan Crha 2008-08-18 09:13:49 UTC
Patch seems correct to me. Add ChangeLog entry to proper file and commit. Thanks.
Comment 4 Milan Crha 2008-08-18 09:15:05 UTC
*** Bug 502758 has been marked as a duplicate of this bug. ***
Comment 5 Matt Davey 2008-08-18 11:15:22 UTC
I'm not sure who Milan was directing #3 to.  I do not have commit rights to Evolution, as far as I know.
Comment 6 Milan Crha 2008-08-18 15:24:34 UTC
Committed to trunk. Committed revision 9380.

OK, I didn't know you cannot do that.
Comment 7 Akhil Laddha 2009-07-29 04:20:57 UTC
*** Bug 532520 has been marked as a duplicate of this bug. ***