5.3.0-git
2016-08-29

[#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 2012-01-10 (1693 days ago)
Due
Updated 2016-07-21 (39 days ago)
Assigned
Resolved 2016-07-21 (39 days ago)
Milestone
Patch No

History
2016-07-21 19:41:26 Michael Rubinsky Assigned to Michael Rubinsky
State ⇒ Resolved
 
2016-07-21 19:40:21 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
2016-07-21 19:25:13 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
2016-07-21 19:25:12 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
2015-11-03 12:16:46 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
2015-09-08 23:52:18 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.
2015-09-08 23:22:57 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?
2015-09-08 22:06:04 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.
2015-09-08 00:45:07 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
2015-09-08 00:13:37 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.
2015-09-07 21:56:06 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.
2015-09-07 15:53:45 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.
2015-09-06 22:20:50 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.
2014-07-28 05:07:10 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).
2014-01-07 23:50:57 Michael Slusarz Comment #4
Queue ⇒ Horde Base
Version ⇒ Git master
Reply to this comment
This is a Horde-wide setting, not an IMP setting (in 
Horde_Core_Ajax_Imple_ContactAutoCompleter).
2013-11-18 14:30:28 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


2012-01-24 15:12:00 Jan Schneider Version ⇒ Git master
 
2012-01-24 15:11:46 Jan Schneider Type ⇒ Enhancement
State ⇒ Feedback
Priority ⇒ 1. Low
 
2012-01-24 15:11:31 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.
2012-01-10 12:19:02 michael (dot) groene (at) zel (dot) uni-hannover (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Autocompleter uses "email"-field only
Queue ⇒ IMP
Milestone ⇒
Patch ⇒ No
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?