[Tickets #12272] Search-all and strict fields

noreply at bugs.horde.org noreply at bugs.horde.org
Fri May 24 12:59:32 UTC 2013


BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN. NACHRICHTEN AN DIESE  
E-MAIL-ADRESSE WERDEN NICHT GELESEN.

Ticket-URL: http://bugs.horde.org/ticket/12272
------------------------------------------------------------------------------
  Ticket           | 12272
  Erstellt Von     | kd at tu-cottbus.de
  Zusammenfassung  | Search-all and strict fields
  Warteschlange    | Turba
  Version          | 4.1.0beta2
  Typ              | Bug
  Status           | Unconfirmed
  Priorität        | 2. Medium
  Milestone        |
  Patch            | 1
  Zuständige       |
------------------------------------------------------------------------------


kd at tu-cottbus.de (2013-05-24 12:59) hat geschrieben:

If in the default sql addressbook an additional field is declared as  
strict, the resulting sql-statement
is wrong. Add for example object_email to the strict-array and do a  
search-all for a valid email.

All -> a at b.c.d

This results in the following query:
         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_photo, object_phototype, 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_logo,
           object_logotype, object_category, object_notes, object_url,
           object_freebusyurl, object_pgppublickey, object_smimepublickey FROM
           turba_objects WHERE (object_email = 'a at b.c.d' OR owner_id = 'kd' AND
           ((LOWER(object_nameprefix) LIKE LOWER('%a at b.c.d%') OR
           LOWER(object_firstname) LIKE LOWER('%a at b.c.d%') OR
           LOWER(object_middlenames) LIKE LOWER('%a at b.c.d%') OR
           LOWER(object_lastname) LIKE LOWER('%a at b.c.d%') OR
           LOWER(object_namesuffix) LIKE LOWER('%a at b.c.d%'))))

This is wrong.
I believe, this is caused by always adding "owner_id = user" as a  
strict search (in Driver.php - search).
It can be solved by "anding" the  "owner_id = user" _after_ the search  
is build (makeSearch).
A possible patch is attached.
Probably this is related to Bug #12089.






More information about the bugs mailing list