6.0.0-beta1
7/4/25

[#10904] Compose window address auto-completion fails with some LDAP records
Summary Compose window address auto-completion fails with some LDAP records
Queue Horde Base
Queue Version 4.0.13
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester jmDS (at) hampshire (dot) edu
Created 01/05/2012 (4929 days ago)
Due
Updated 08/29/2012 (4692 days ago)
Assigned 01/24/2012 (4910 days ago)
Resolved 01/26/2012 (4908 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
08/29/2012 12:28:32 PM Git Commit Comment #8 Reply to this comment
Changes have been made in Git (master):

commit e4c6ee8061723eba23d61809b9f975bed813aafc
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Thu Jan 26 17:30:14 2012 -0500

     Don't attempt to iterate matches if we don't have any.

     Fixes Bug: 10904

  framework/Core/js/autocomplete.js |   18 ++++++++++--------
  1 files changed, 10 insertions(+), 8 deletions(-)

http://git.horde.org/horde-git/-/commit/e4c6ee8061723eba23d61809b9f975bed813aafc
01/26/2012 10:37:41 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git (refs/heads/develop):

commit e9b27cee7c1a98e44dd07180f3286a2454d54b38
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Thu Jan 26 17:30:14 2012 -0500

     Don't attempt to iterate matches if we don't have any.

     Fixes Bug: 10904

  framework/Core/js/autocomplete.js |   18 ++++++++++--------
  1 files changed, 10 insertions(+), 8 deletions(-)
http://git.horde.org/horde-git/-/commit/e9b27cee7c1a98e44dd07180f3286a2454d54b38
01/26/2012 10:37:27 PM Git Commit Comment #6 Reply to this comment
Changes have been made in Git (refs/heads/develop):

commit e4c6ee8061723eba23d61809b9f975bed813aafc
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Thu Jan 26 17:30:14 2012 -0500

     Don't attempt to iterate matches if we don't have any.

     Fixes Bug: 10904

  framework/Core/js/autocomplete.js |   18 ++++++++++--------
  1 files changed, 10 insertions(+), 8 deletions(-)
http://git.horde.org/horde-git/-/commit/e4c6ee8061723eba23d61809b9f975bed813aafc
01/26/2012 10:35:34 PM Michael Rubinsky State ⇒ Resolved
 
01/26/2012 10:33:26 PM Git Commit Comment #5 Reply to this comment
Changes have been made in Git (refs/heads/master):

commit e9b27cee7c1a98e44dd07180f3286a2454d54b38
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Thu Jan 26 17:30:14 2012 -0500

     Don't attempt to iterate matches if we don't have any.

     Fixes Bug: 10904

  framework/Core/js/autocomplete.js |   18 ++++++++++--------
  1 files changed, 10 insertions(+), 8 deletions(-)
http://git.horde.org/horde-git/-/commit/e9b27cee7c1a98e44dd07180f3286a2454d54b38
01/24/2012 04:04:45 PM Michael Rubinsky Comment #4 Reply to this comment
Looking at the code though, it looks like the filtering is also done 
elsewhere, at least for the non-ajax case. There is some other stuff 
that doesn't look right also - l can take a look when I get back 
tonight or Wednesday.
01/24/2012 03:32:29 PM Michael Rubinsky Comment #3 Reply to this comment

IIUC the matching done in that code snippit is to both apply the 
strong styling to the typed search terms (which won't be in the 
displayed text in the case the OP describes) and also to filter the 
choices when we are not using AJAX or the backend doesn't support 
searching.
01/24/2012 03:15:08 PM Jan Schneider Comment #2
State ⇒ Feedback
Assigned to Michael Rubinsky
Reply to this comment
Mike, is there a reason that we match them one more time against the 
search string? Maybe to work with sources that don't support searching 
but return everything, like the preference backend? Or is this not 
happening anymore anyway?
01/05/2012 10:33:04 PM jmDS (at) hampshire (dot) edu Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Compose window address auto-completion fails with some LDAP records
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
If Turba is configured to search LDAP attributes that are not a part 
of the displayed contact information, address auto-completion in the 
compose window fails.

For example, if I have Turba configured to search a 'nickname' 
attribute, but the contact string is of the form "Firstname Lastname 
<email@addess>", and I search for text that only exists in the 
nickname, auto-completion will fail. This applies to searches with 
many results, if one of them fits the above criteria. So, if I search 
for 'Bob', and that string is in someone's nickname attribute only 
(their first name is 'Robert'), no auto-completion results will be 
shown at all.

I believe this problem is in horde/js/autocomplete.js starting on line 
119. in the code that highlights the part of each auto-completion 
result that matches the text you've typed so far. If what I've typed 
does not appear in one of the elements in the array 'choices', 
n.match(re) returns nothing, and calling each() on it on line 123 
results in an error. If I change the code to use an empty array when 
n.match(re) fails, auto-completion works as I would expect:

-                n.match(re).each(function(m) {
+                var matches = n.match(re);
+
+                if (matches == null) {
+                        matches = new Array();
+                }
+
+                matches.each(function(m) {

Saved Queries