fix preprocessor to set default taglist autocomplete_url/searchUrl, if none is set and change autocomplte_params to searchOptions

an empty autocomplete_url is preserved, as it was used to disable autocomplete
This commit is contained in:
ralf 2022-09-14 09:09:56 +02:00
parent 6727f72185
commit 5a20f5965e

View File

@ -228,15 +228,12 @@ function send_template()
$attrs['editModeEnabled'] = 'true';
}
}
if (isset($attrs['autocomplete_url']))
$attrs['searchUrl'] = $attrs['autocomplete_url'] ?? 'EGroupware\\Api\\Etemplate\\Widget\\Taglist::ajax_search';
if (isset($attrs['autocomplete_params']))
{
$attrs['searchUrl'] = $attrs['autocomplete_url'];
if (isset($attrs['autocomplete_params']))
{
$attrs['searchOptions'] = $attrs['autocomplete_params'];
}
unset($attrs['autocomplete_url'], $attrs['autocomplete_params']);
$attrs['searchOptions'] = $attrs['autocomplete_params'];
}
unset($attrs['autocomplete_url'], $attrs['autocomplete_params']);
if (isset($attrs['maxSelection']) && $attrs['maxSelection'] === '1')
{
unset($attrs['multiple'], $attrs['maxSelection']);