[Tickets #10681] Autocompleter in IMP with inconsistent results
bugs at horde.org
bugs at horde.org
Tue Oct 25 13:39:25 UTC 2011
BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN. NACHRICHTEN AN DIESE
E-MAIL-ADRESSE WERDEN NICHT GELESEN.
Ticket-URL: http://bugs.horde.org/ticket/10681
------------------------------------------------------------------------------
Ticket | 10681
Erstellt Von | michael.groene at zel.uni-hannover.de
Zusammenfassung | Autocompleter in IMP with inconsistent results
Warteschlange | Horde Base
Version | 4.0.10
Typ | Bug
Status | Unconfirmed
Priorität | 2. Medium
Milestone |
Patch |
Zuständige |
------------------------------------------------------------------------------
michael.groene at zel.uni-hannover.de (2011-10-25 13:39) hat geschrieben:
I probed the autocomplete feature in IMP a longer time since now.
Before a few weeks something was corrected in the autocompleter code,
but this is not what my problem solved, too.
The issue is, that the autocompleter will most of the time not show up
until I wrote 4 letters, though I set ac_threshold to 1, even the
maximum (200) can't be hit. Another time the autocompleter won't
filter again, when typing the 3rd letter, typing the 4th will filter
again.
This behaviour I get, when I use the hook as given in the examples:
public function prefs_init($pref, $value, $username, $scope_ob)
{
switch ($pref) {
case 'add_source':
// Dynamically set the add_source preference.
// Example: Useful hook when using a Turba source with shares
// enabled (i.e. the example localsql configuration).
return is_null($username)
? $value
: $GLOBALS['registry']->call('contacts/getDefaultShare');
case 'search_fields':
case 'search_sources':
// Dynamically set the search_fields/search_sources preferences.
// Example #1: Use the list of sources defined in the contacts
// application (e.g. Turba).
#Horde::debug($pref);
if (!is_null($username) &&
$GLOBALS['registry']->hasMethod('contacts/sources')) {
$sources = $GLOBALS['registry']->call('contacts/sources');
if ($pref == 'search_fields') {
$out = array();
foreach (array_keys($sources) as $source) {
$out[$source] =
array_keys($GLOBALS['registry']->call('contacts/fields',
array($source)));
}
} else {
$out = array_keys($sources);
}
# Horde::debug($out);
return json_encode($out);
}
return $value;
}
}
When I set this on my own in the preferences so that it will be saved
in the pref-table, the autocompleter works correctly.
More information about the bugs
mailing list