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 |
State ⇒ Resolved
Milestone ⇒ 2.2.2
State ⇒ Feedback
Taken from
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.
http://cvs.horde.org/diff.php/turba/lib/Driver.php?r1=1.202&r2=1.203&ty=u
http://cvs.horde.org/diff.php/turba/lib/Driver/sql.php?r1=1.116&r2=1.117&ty=u
Assigned to
Priority ⇒ 2. Medium
fix this cleanly.
State ⇒ Assigned
Priority ⇒ 3. High
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 ''.
Taken from
State ⇒ Resolved
http://cvs.horde.org/diff.php/turba/lib/Driver.php?r1=1.198&r2=1.199&ty=u
http://cvs.horde.org/diff.php/turba/lib/Driver/sql.php?r1=1.114&r2=1.115&ty=u
State ⇒ Feedback
Patch ⇒ Yes
New Attachment: turba.patch
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.
Version ⇒ HEAD
Queue ⇒ Turba
State ⇒ Assigned
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ "add ... to My Address Book" problems based on composite name field
Type ⇒ Bug
Queue ⇒ IMP
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