6.0.0-alpha14
7/3/25

[#10913] Autocompleter uses "email"-field only
Summary Autocompleter uses "email"-field only
Queue Horde Base
Queue Version Git master
Type Enhancement
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester michael.groene (at) zel (dot) uni-hannover (dot) de
Created 01/10/2012 (4923 days ago)
Due
Updated 10/20/2017 (2813 days ago)
Assigned
Resolved 07/21/2016 (3269 days ago)
Milestone
Patch No

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

commit dfa16c1a1e8f714173520f5ab8f660396b616d52
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Thu, 21 Jul 2016 15:29:26 -0400

Add 'emailSearch' option to Turba_Api::search.

Ensures all available email type fields are included and returned
in search results. Done as part of Turba_Api::search in place of
an additional API method to provide a clean, BC, solution that falls
back gracefully to previous behavior. To be revisted in Horde 6.

See Bug: 10913

  M lib/Api.php

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

commit a708dbb6b667ab8238ac2d7e370270f2a0c064cd
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Thu Jul 21 14:41:21 2016 -0400

     Add 'emailSearch' option to Turba_Api::search.

     Ensures all available email type fields are included and returned
     in search results. Done as part of Turba_Api::search in place of
     an additional API method to provide a clean, BC, solution that falls
     back gracefully to previous behavior. To be revisted in Horde 6.

     See Bug: 10913

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

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

commit 0cdf283b60733fbbd943665b30247e1369e53106
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Thu Jul 21 14:46:49 2016 -0400

     Use the 'emailSearch' if it's available.

     See Bug: 10913

  framework/Core/lib/Horde/Core/Ajax/Imple/ContactAutoCompleter.php | 3 ++-
  imp/lib/Contacts.php                                              | 3 ++-
  2 files changed, 4 insertions(+), 2 deletions(-)

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

commit 5973a65e66df21be6e4861c0b81fa840ad570693
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Thu Jul 21 14:41:21 2016 -0400

     Add 'emailSearch' option to Turba_Api::search.

     Ensures all available email type fields are included and returned
     in search results. Done as part of Turba_Api::search in place of
     an additional API method to provide a clean, BC, solution that falls
     back gracefully to previous behavior. To be revisted in Horde 6.

     See Bug: 10913

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

http://github.com/horde/horde/commit/5973a65e66df21be6e4861c0b81fa840ad570693
11/03/2015 12:16:46 PM asa (at) isac (dot) gov (dot) in Comment #15 Reply to this comment
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
09/08/2015 11:52:18 PM Michael Rubinsky Comment #13 Reply to this comment
Nevermind.  There is a bug in Turba that turns the OR search into an 
AND search when 'strict' fields are present.
09/08/2015 11:22:57 PM Michael Rubinsky Comment #12 Reply to this comment

Are the email fields of your source present in the 'search' parameter 
of it's configuration in backends.local.php?
09/08/2015 10:06:04 PM bjoernv (at) arcor (dot) de Comment #11 Reply to this comment
This is a separate issue. The Turba_API::getField() method needs to
include all fields of type 'email' in it's search.
This part, at least, is fixed by:
https://github.com/horde/horde/commit/cd3595fb171969e8ba9a53fbc529bc2a657d4dd6
I applied this patch to my Horde 5.2.10 setup. Unfortunately, Turba 
doesn't find the free/busy URL for contacts specified by E-Mail anymore.

Steps:
1) patch Turba (horde/turba/lib/Api.php and horde/turba/lib/Turba.php)
2) ensure, that there is a valid address book entry with an e-mail 
address "test@example.com" in email field
3) create an event an invite the contact test@example.com

With debug statements I saw, that $criterium is an array with the 
element "test@example.com". But

$list = $sdriver->search($criterium, null, 'OR', array(), $strict ? 
array_keys($criterium) : array());

in horde/turba/lib/Api.php doesn't find the free/busy URL.
09/08/2015 12:45:07 AM Michael Rubinsky Comment #10 Reply to this comment
This is a separate issue. The Turba_API::getField() method needs to 
include all fields of type 'email' in it's search.
This part, at least, is fixed by:
https://github.com/horde/horde/commit/cd3595fb171969e8ba9a53fbc529bc2a657d4dd6
09/08/2015 12:13:37 AM Michael Rubinsky Comment #9 Reply to this comment
E-mail autocompletion works with changes suggested in #c3 (see my 
attached patch).
Yes, but that file/library is outside of Turba's (or any other 
application providing the contacts/ API) scope and can't use anything 
that requires knowledge of the application's configuration/internals. 
That's why Michael S. indicated we need a specific email search API.
But Turba does not find the free/busy URL for contacts, where the 
matching email address is workEmail or homeEmail. So at least one 
additional function has to be fixed.
This is a separate issue. The Turba_API::getField() method needs to 
include all fields of type 'email' in it's search.
09/07/2015 09:56:06 PM bjoernv (at) arcor (dot) de Comment #8
New Attachment: autocomplete-email.patch Download
Reply to this comment
homeEmail and workEmail values are completely ignored here:
- typing email addresses in "new message" form of IMP
- creating events and add attendees (no free/busy information is 
found, if the email is only in homeEmail or workEmail
E-mail autocompletion works with changes suggested in #c3 (see my 
attached patch).

But Turba does not find the free/busy URL for contacts, where the 
matching email address is workEmail or homeEmail. So at least one 
additional function has to be fixed.
09/07/2015 03:53:45 PM Michael Rubinsky Comment #7
State ⇒ Accepted
Reply to this comment
Unfortunately the issue is still present in Horde (tested with Horde 5.2.10).
Which is why the ticket is still opened. :)
I think, it's important to fix this issue. Otherwise many Horde 
users have to create separate address book entries for each email 
address of one real person.
If you read the ticket, you'll see the limitations we have to work 
with. With our limited resources, no developer has not yet had time 
devoted to it.

If this issue is important enough to you to be fixed, consider 
sponsoring the work.
09/06/2015 10:20:50 PM bjoernv (at) arcor (dot) de Comment #6 Reply to this comment
Unfortunately the issue is still present in Horde (tested with Horde 5.2.10).

I use the three email fields predefined in 
horde/turba/config/backends.local.php

$cfgSources['localsql']['search'] = array(
         'name',
         'email',
         'homeEmail',
         'workEmail',
     );

homeEmail and workEmail values are completely ignored here:
- typing email addresses in "new message" form of IMP
- creating events and add attendees (no free/busy information is 
found, if the email is only in homeEmail or workEmail

But homeEmail and workEmail searches work in Turba search.

I think, it's important to fix this issue. Otherwise many Horde users 
have to create separate address book entries for each email address of 
one real person.
07/28/2014 05:07:10 AM Michael Slusarz Comment #5 Reply to this comment
This is similar to #12480, but not really.

In short... what we really need is an API method in Turba for plain 
email search.  Pass it a string, and it searches all e-mail fields 
(and name fields, as an additional option).  Returns only the e-mails 
that match, not all entries.

This could all theoretically be done remotely ... but I've just spent 
2 hours trying to implement this in IMP and realized that it makes no 
sense.  Since I'm trying to do things like grab the configuration file 
from Turba and parse various fields (which is not documented in the 
external application API).  This is hackish at best, and will result 
in duplicate code at worst since this common code needs to be 
duplicated elsewhere (IMP is not going to use Horde_Core's 
autocomplete code going forward for multiple reasons).
01/07/2014 11:50:57 PM Michael Slusarz Comment #4
Version ⇒ Git master
Queue ⇒ Horde Base
Reply to this comment
This is a Horde-wide setting, not an IMP setting (in 
Horde_Core_Ajax_Imple_ContactAutoCompleter).
11/18/2013 02:30:28 PM registrations (at) baruchgreen (dot) net Comment #3 Reply to this comment
In the current versions of Imp/Turba (6.1.5 and 4.1.3, respectively) 
this is quite easy to fix.  Go to line 67 of ContactAutocompleter.php

                 'returnFields' => array('email', 'name'),

And simply insert the additional email fields from your turba 
backends.local.php into the array between 'email' and 'name'.  For me 
it ends up being:

                 'returnFields' => array('email', 'workEmail', 
'homeEmail', 'name'),

Works like a charm.

-- Seth Green


01/24/2012 03:12:00 PM Jan Schneider Version ⇒ Git master
 
01/24/2012 03:11:46 PM Jan Schneider Type ⇒ Enhancement
State ⇒ Feedback
Priority ⇒ 1. Low
 
01/24/2012 03:11:31 PM Jan Schneider Comment #2 Reply to this comment
I think this should be mentioned somewhere in documentation, is it?
Patch?
Or maybe even better, the autocompleter would accept different 
mail-fields, e.g. all fields, marked as type="email" in 
attributes.php?
Sounds good.
01/10/2012 12:19:02 PM michael (dot) groene (at) zel (dot) uni-hannover (dot) de Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ Autocompleter uses "email"-field only
Type ⇒ Bug
Queue ⇒ IMP
Reply to this comment
I was irritated by the results of the Autocompleter in IMP once more...

Our global addressbook contains just work-mailaddresses, so I 
configured turbas database-backend accordingly.

It was like this in backends.local.php:
** snip **
         'homePostalCode' => 'postcode',
         'workEmail' => 'email_zew',
         'workPhone' => 'phone_zew',
** snip **
         'search'=>array('name','workEmail'),
** snip **

Now I found out the reason, why the autocompleter completely ignored 
this source (lib/imp/Ajax/Imple/ContactAutoCompleter.php:46ff):
             foreach ($sparams['fields'] as $val) {
                 array_map('strtolower', $val);
                 sort($val);
                 if ($val != array('email', 'name')) {
                     $success = false;
                     break;
                 }
             }

So at least the keys email and name have to be present in source.
I think this should be mentioned somewhere in documentation, is it?
Or maybe even better, the autocompleter would accept different 
mail-fields, e.g. all fields, marked as type="email" in attributes.php?

Saved Queries