6.0.0-beta1
7/10/25

[#7876] Searching with more than one strict fields
Summary Searching with more than one strict fields
Queue Turba
Queue Version 2.3.1
Type Bug
State Resolved
Priority 1. Low
Owners chuck (at) horde (dot) org
Requester tinu (at) humbapa (dot) ch
Created 01/20/2009 (6015 days ago)
Due
Updated 02/16/2009 (5988 days ago)
Assigned 02/10/2009 (5994 days ago)
Resolved 02/16/2009 (5988 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
02/16/2009 02:21:33 AM Chuck Hagenbuch Comment #7
State ⇒ Resolved
Reply to this comment
Committed, thanks!
02/16/2009 02:18:36 AM Chuck Hagenbuch Comment #5
Assigned to Chuck Hagenbuch
Taken from Horde DevelopersHorde Developers
Reply to this comment
My reproduce script for posterity:



define('AUTH_HANDLER', true);

require '../lib/base.php';



$_SERVER['REMOTE_ADDR'] = '127.0.0.1';

$auth = &Auth::singleton($conf['auth']['driver']);

$auth->setAuth('chuck', array());



require './lib/base.php';



$driver = Turba_Driver::singleton('jenn');

if (is_a($driver, 'PEAR_Error')) {

     var_dump($driver);

     exit(1);

}

$content = array('__type' => 'Group', '__owner' => 'chuck', 'name' => 
'DinnerParty');

$result = $driver->search($content);

var_dump($result);
02/10/2009 04:53:31 PM Chuck Hagenbuch Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
01/25/2009 11:15:28 AM tinu (at) humbapa (dot) ch Comment #4 Reply to this comment
I'm working on a new module where I would like to create new contact 
lists in turba. Right now I do this via api-call:



$apiargs = array(

     'content' => array(

         '__type' => 'Group',

         '__members' => serialize($this->_vars->get('students')),

         'name' => $this->_vars->get('contact_list')),

     'contentType' => 'array',

     'source' => $this->_vars->get('address_book')

);

$result = $registry->call('contacts/import', $apiargs);



The import methode then adds 'owner' as the second strict element and 
tries to search for an allready existing entry. Without my patch this 
search results in a mySQL syntax error because the two strict fields 
'type' and 'owner' are not combined by 'AND' or 'OR'.
01/24/2009 04:12:38 PM Chuck Hagenbuch Comment #3
State ⇒ Feedback
Reply to this comment
Can you please provide an example of the usage that shows this problem?
01/20/2009 06:53:19 PM tinu (at) humbapa (dot) ch Comment #2
New Attachment: Driver.php.patch Download
Reply to this comment
ups I forgot to add the patch...

sorry!
01/20/2009 06:51:50 PM tinu (at) humbapa (dot) ch Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Searching with more than one strict fields
Queue ⇒ Turba
Milestone ⇒
Patch ⇒ Yes
State ⇒ Unconfirmed
Reply to this comment
If I use the search() methode from turba/lib/Driver.php with more than 
one strict field and some other fields as search criteria it returns a 
PEAR DB Error message.



My small patch adds the missing search type to the strict_search array.



thanks!

Saved Queries