From 5a20f5965e060db9bbd16bdb457ca5e0e72948cc Mon Sep 17 00:00:00 2001 From: ralf Date: Wed, 14 Sep 2022 09:09:56 +0200 Subject: [PATCH] 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 --- api/etemplate.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/api/etemplate.php b/api/etemplate.php index 1db27216e9..144271439b 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -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']);