6.0.0-beta1
7/18/25

[#13945] Autocomplete with custom parameter not working for LDAP
Summary Autocomplete with custom parameter not working for LDAP
Queue Turba
Queue Version 4.2.5
Type Bug
State Resolved
Priority 1. Low
Owners Horde Developers (at) , mrubinsk (at) horde (dot) org
Requester asa (at) isac (dot) gov (dot) in
Created 04/10/2015 (3752 days ago)
Due
Updated 10/20/2017 (2828 days ago)
Assigned 02/02/2016 (3454 days ago)
Resolved 07/21/2016 (3284 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/20/2017 08:34:47 PM Git Commit Comment #8 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit bf12ca28c4032b556a906ec45cced8773ac90ab4
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Thu, 21 Jul 2016 15:32:49 -0400

Bug: 13945 Make sure we were not too agressive in filtering out hits.

  M lib/Api.php

https://github.com/horde/turba/commit/bf12ca28c4032b556a906ec45cced8773ac90ab4
07/21/2016 07:41:51 PM Michael Rubinsky Assigned to Michael Rubinsky
State ⇒ Resolved
 
07/21/2016 07:40:23 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit c5bf85a0007e3f1cd7d836df323920275a65ca5a
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Thu Jul 21 15:23:15 2016 -0400

     Bug: 13945 Make sure we were not too agressive in filtering out hits.

  turba/lib/Api.php | 15 +++++++++++++--
  1 file changed, 13 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/c5bf85a0007e3f1cd7d836df323920275a65ca5a
07/21/2016 07:25:14 PM Git Commit Comment #6 Reply to this comment
Changes have been made in Git (master):

commit a6fbfefe98f0c6034230e50ca7c4be7ba1fc2ad6
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Thu Jul 21 15:23:15 2016 -0400

     Bug: 13945 Make sure we were not too agressive in filtering out hits.

  turba/lib/Api.php | 15 +++++++++++++--
  1 file changed, 13 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/a6fbfefe98f0c6034230e50ca7c4be7ba1fc2ad6
07/21/2016 07:00:56 PM Michael Rubinsky Comment #5 Reply to this comment
I don't think, it is duplicate of 10913.  My concern is with 
searching attribute and not return attribute.  can this bug be 
re-opened.
This actually is (mostly) a duplicate of Ticket: 10913. The field is 
being correctly searched (when the field is properly included in the 
search_fields pref). The issue is that we have code in Turba that 
filters out results in certain cases in order to prevent duplicate 
hits. E.g., if the contact has two email addresses, only the one with 
the matching text is returned.
02/02/2016 09:58:18 AM Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
11/02/2015 08:18:56 AM asa (at) isac (dot) gov (dot) in Comment #4 Reply to this comment
I don't think, it is duplicate of 10913.  My concern is with 
searching attribute and not return attribute.  can this bug be 
re-opened.
I was optimistic that the following would have fixed #13945 issue. 
But, does not.

-------------------------------------------------------------------------------------------------
Allow Turba_Api::getField to search any attribute of type 'email'.

Any email attribute present in the source's map and 'search' settings
will be considered. Fixes FB urls not being found for email addresses
not contained in 'email' field.

This was solved in commits on Sep 8th 2015 through commit 
cd3595fb171969e8ba9a53fbc529bc2a657d4dd6
----------------------------------------------------------------------------------------

04/13/2015 12:20:46 PM asa (at) isac (dot) gov (dot) in Comment #3 Reply to this comment
I don't think, it is duplicate of 10913.  My concern is with searching 
attribute and not return attribute.  can this bug be re-opened.
04/10/2015 01:15:29 PM Michael Rubinsky Comment #2
State ⇒ Duplicate
Reply to this comment
04/10/2015 12:35:23 PM asa (at) isac (dot) gov (dot) in Comment #1
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Turba
Summary ⇒ Autocomplete with custom parameter not working for LDAP
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
I have recently installed latest stable version of HGWE and testing it.

Autocomplete is not working for one of the attribute which I have
mentioned in search under LDAP.

for IMP, prefs.local.php, I have set

$_prefs['search_sources']['hook'] = true;
$_prefs['search_fields']['hook'] = true;
$_prefs['add_source']['hook'] = true;

enabled the hooks in imp/hooks.local.php


for turba,

turba/attributes.local.php (the file contains additional attribute,
which is refereed in LDAP)

<?php
$attributes['staffno'] = array(
      'label' => _("StaffNumber"),
      'type' => 'text',
      'required' => false,
      'params' => array('regex' => '', 'size' => 32, 'maxlength' => 32)
);

$attributes['postalAddress'] = array(
      'label' => _("Postal Address"),
      'type' => 'text',
      'required' => false,
);

$attributes['cn'] = array(
      'label' => _("Complete Name"),
      'type' => 'text',
      'required' => false,
);


turba/backends.local.php

<?php
$cfgSources['localsql']['title'] = 'My Address Book';
$cfgSources['localsql']['use_shares'] = false;
$cfgSources['localldap']['disabled'] = false;
$cfgSources['localldap']['title'] = 'LDAP Directory';
$cfgSources['localldap']['params']['server'] = 'xxx.xx.x.xx';
$cfgSources['localldap']['params']['root'] = 'dc=xxxx,dc=xxx';
$cfgSources['localldap']['params']['bind_dn'] = 'cn=Manager,dc=xxx';
$cfgSources['localldap']['params']['bind_password'] = 'xxxxxxxxxx';
$cfgSources['localldap']['params']['limit'] = 20;
$cfgSources['localldap']['params']['scope'] = 'sub';
$cfgSources['localldap']['map'] = array(
          '__key' => 'dn',
          '__uid' => 'mailacceptinggeneralid',
          'staffno' => 'staffnumber',
          'postalAddress' => 'postalAddress',
          'cn' => 'cn',
          'name' => array('fields' => array('cn', 'postalAddress'),
                          'format' => '%s %s',
                          'parse' => array(
                              array('fields' => array('cn'),
                                    'format' => '%s' ),
                              array('fields' => array('cn', 'postalAddress'),
                                    'format' => '%s', '%s' ))),
          'email' => 'mail',
          'freebusyUrl' => 'uid'
      );
$cfgSources['localldap']['search'] =  array('staffno','name','email');
$cfgSources['localldap']['export'] =  false;
$cfgSources['localldap']['browse'] =  false;

turba/prefs.local.php

<?php
$prefGroups['addressbooks']['suppress'] = true;
$prefGroups['sync']['suppress'] = true;
$prefGroups['columns']['suppress'] = true;
$_prefs['default_dir']['locked'] = true;
$_prefs['default_dir']['value'] = 'localsql';
$_prefs['columns']['locked'] = true;
$_prefs['columns']['value']=
"localsql\temail\nlocalldap\temail\tstaffno\nfavourites\temail";


With these settings, if I try to autocomplete on staff number, it does
not work.  While on name and email it works.

Saved Queries