[imp] "add ... to My Address Book" button on message composition screen behavior change

liamr at umich.edu liamr at umich.edu
Thu May 29 16:30:32 UTC 2008


>> In IMP 4.0.x and 4.1.x, if you pressed the "add ... to My Address
>> Book" button..
>> - the first time, it would add the address to your address book
>> - all subsequent times, it would say "Already Exists"
>>
>> In IMP 4.2, it looks you can press that "add ... to My Address Book"
>> button as many times as you like, and it will continue add the same
>> address over and over again.
>>
>> Was this an intentional change?
>
> No, and furthermore it's not how it works for me. That indicates that
> the duplicate search that's done isn't working for you for some reason
> - I'd check Turba logs.

The turba logs weren't helpful.. so I turned on transaction logging.  
Here's the kind of query I'm seeing when I use the "add .. to my 
Address Book" button:


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 at example.edu%')
    )
)

which doesn't match a damn thing.

If I assemble the SQL by hand, removing prefix, middlename and suffix, 
I get matches.

SO... I check turba/config/sources.php and switch from the extended 
version of the "name" field..

        'name' => array('fields' => array('namePrefix', 'firstname',
                                          'middlenames', 'lastname',    
                                           'nameSuffix'),
                        'format' => '%s %s %s %s %s',
                        'parse' => array(
                            array('fields' => array('firstname', 'middlenames',
                                                    'lastname'),
                                  'format' => '%s %s %s'),
                            array('fields' => array('firstname', 'lastname'),
                                  'format' => '%s %s'))),


to the abbreviated version of the name field..

        'name' => array('fields' => array('firstname', 'lastname'),
                        'format' => '%s %s'),

Now my "Already Exists" warnings are popping up again.  This should be 
documented (or preferably fixed somehow).  I'm guessing this will be 
broken for other people that are using the super extended definition of 
the composite name variable.

Liam


More information about the imp mailing list