diff --git a/api/etemplate.php b/api/etemplate.php index b03d5ab039..54a77a017c 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -234,11 +234,16 @@ function send_template() $attrs['editModeEnabled'] = 'true'; } } - $attrs['searchUrl'] = $attrs['autocomplete_url'] ?? 'EGroupware\\Api\\Etemplate\\Widget\\Taglist::'. - ($matches[2] === '-email' ? 'ajax_email' : 'ajax_search'); - if (isset($attrs['autocomplete_params'])) + // only set (default) searchUrl for regular taglist or taglist-email, or if a non-empty autocomplete_url was given + if (empty($matches['2']) || $matches[2] === '-email' || !empty($attrs['autocomplete_url'])) { - $attrs['searchOptions'] = $attrs['autocomplete_params']; + $attrs['searchUrl'] = $attrs['autocomplete_url'] ?? 'EGroupware\\Api\\Etemplate\\Widget\\Taglist::'. + ($matches[2] === '-email' ? 'ajax_email' : 'ajax_search'); + + if (isset($attrs['autocomplete_params'])) + { + $attrs['searchOptions'] = $attrs['autocomplete_params']; + } } unset($attrs['autocomplete_url'], $attrs['autocomplete_params']); if (isset($attrs['maxSelection']) && $attrs['maxSelection'] === '1')