6.0.0-beta1
7/19/25

[#6796] "add ... to My Address Book" problems based on composite name field
Summary "add ... to My Address Book" problems based on composite name field
Queue Turba
Queue Version HEAD
Type Bug
State Resolved
Priority 2. Medium
Owners mrubinsk (at) horde (dot) org
Requester liamr (at) umich (dot) edu
Created 05/30/2008 (6259 days ago)
Due
Updated 07/06/2008 (6222 days ago)
Assigned 07/05/2008 (6223 days ago)
Resolved 07/06/2008 (6222 days ago)
Github Issue Link
Github Pull Request
Milestone 2.2.2
Patch No

History
07/06/2008 04:22:37 PM Michael Rubinsky Comment #11
State ⇒ Resolved
Reply to this comment
Merging, this has been operating fine for me for the past two days.
07/05/2008 02:12:20 PM Michael Rubinsky Comment #10
Milestone ⇒ 2.2.2
State ⇒ Feedback
Taken from Horde DevelopersHorde Developers
Reply to this comment
Committed a slightly different version and this seems to fix the 
original issue and does not cause any issues with listing complete 
address books using the empty string.



Will wait for some feeback/other testing before merging.
07/05/2008 02:07:15 PM Michael Rubinsky Deleted Original Message
 
06/23/2008 05:20:13 PM Michael Rubinsky Comment #8
Assigned to Horde DevelopersHorde Developers
Priority ⇒ 2. Medium
Reply to this comment
Reverted the "fix"...and I'm currently hitting a wall regarding how to 
fix this cleanly.
06/23/2008 08:24:42 AM Jan Schneider Comment #7
State ⇒ Assigned
Priority ⇒ 3. High
Reply to this comment
This completely broke listing of all address book entries when not 
using a composite name field, e.g. in imp's address book popup or the 
clients listing in hermes. With these changes only contacts that don't 
have a name are listed.

To list all contacts of an address book, we search for an empty string ''.
06/16/2008 06:58:15 PM Michael Rubinsky Comment #6
Taken from Horde DevelopersHorde Developers
State ⇒ Resolved
Reply to this comment
Fixed for Turba 2.2.2
06/16/2008 05:17:39 PM Chuck Hagenbuch Comment #4 Reply to this comment
Works okay for me.
06/15/2008 06:55:24 PM Michael Rubinsky Comment #3
State ⇒ Feedback
Patch ⇒ Yes
New Attachment: turba.patch
Reply to this comment
This patch fixes the issue. It's tested with SQL driver, but I would 
appreciate feedback/testing with other drivers before it gets committed.



Basically, adds an additional check on each of the individual fields 
the composite field is composed of that allows that field to be empty. 
  The SQL driver was patched to turn a check for '=' or 'LIKE' against 
an empty string to also include a check for IS NULL.
06/14/2008 07:42:01 PM Michael Rubinsky Comment #2
Version ⇒ HEAD
Queue ⇒ Turba
Reply to this comment
...this is most definitely a Turba issue.
06/12/2008 08:07:15 PM Michael Rubinsky Assigned to Michael Rubinsky
 
06/04/2008 10:17:11 PM Chuck Hagenbuch Priority ⇒ 2. Medium
 
05/31/2008 02:18:10 PM Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
05/30/2008 02:08:40 PM liamr (at) umich (dot) edu Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ "add ... to My Address Book" problems based on composite name field
Type ⇒ Bug
Queue ⇒ IMP
Reply to this comment
I wasn't sure if this was a Turba problem or an IMP problem.



The "Add ... to my Address Book" button depends on the "name" field 
definition for the source defined by $_prefs['add_source'].



In Turba 2.2, SQL based address books have split the name field up 
into it's component fields - first, last, middle, prefix, suffix, 
etc..  The default version of "name" is a composite version of all of 
those fields, though an abbreviated "first and last only" version is 
given as an example in the comments.



If you use the "full" version of the name field definition, "Add ... 
to my Address Book" doesn't work, because the SQL it generates tries 
to match too many things:



SELECT object_id, owner_id, object_type, object_members, object_uid,

object_firstname, object_lastname, object_middlenames,

object_nameprefix, object_namesuffix, object_alias, object_bday,

object_homestreet, object_homepob, object_homecity,

object_homeprovince, object_homepostalcode, object_homecountry,

object_workstreet, object_workpob, object_workcity,

object_workprovince, object_workpostalcode, object_workcountry,

object_tz, object_email, object_homephone, object_workphone,

object_cellphone, object_fax, object_pager, object_title, object_role,

object_company, object_category, object_notes, object_url,

object_freebusyurl, object_pgppublickey, object_smimepublickey FROM

turba_objects WHERE (

     owner_id = 'liamr'    AND (

         (

             (LOWER(object_nameprefix) LIKE LOWER('%Joe%') OR

LOWER(object_nameprefix) LIKE LOWER('%User%'))

             AND (LOWER(object_firstname) LIKE LOWER('%Joe%') OR 
LOWER(object_firstname) LIKE LOWER('%User%'))

             AND (LOWER(object_middlenames) LIKE LOWER('%Joe%') OR

LOWER(object_middlenames) LIKE LOWER('%User%'))

             AND (LOWER(object_lastname) LIKE LOWER('%Joe%') OR 
LOWER(object_lastname) LIKE LOWER('%User%'))

             AND (LOWER(object_namesuffix) LIKE

LOWER('%Joe%') OR LOWER(object_namesuffix) LIKE LOWER('%User%'))

         )    AND LOWER(object_email) LIKE LOWER('%juser@example.edu%')

     )

)



I guess it's possible it might work with a name that had all the 
components ("Mr. Joseph Xavier User III"), but his SQL won't ever 
match when given a name only made up of a first and last name.



Since it doesn't match, "Add ... to my Address Book" will allow you to 
add the same address over and over again to your address book.



If you use the shorter version of the composite name field (first and 
last only), you can add an address once, and subsequent attempts are 
met with a notices that the entry "Already Exists".



Chuck thought it was a bug..



http://marc.info/?l=imp&m=121211283608734&w=2

Saved Queries