GNOME Bugzilla – Bug 547223
e_contact_set_property will overwrite "business phone" when setting "other phone"
Last modified: 2009-07-29 04:20:57 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
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;".
Milan, can you review this?
Patch seems correct to me. Add ChangeLog entry to proper file and commit. Thanks.
*** Bug 502758 has been marked as a duplicate of this bug. ***
I'm not sure who Milan was directing #3 to. I do not have commit rights to Evolution, as far as I know.
Committed to trunk. Committed revision 9380. OK, I didn't know you cannot do that.
*** Bug 532520 has been marked as a duplicate of this bug. ***