Skip to content

Commit

Permalink
Check if a static filter is used for autosuggestions in the components
Browse files Browse the repository at this point in the history
default_form and omit the parameter f in the serviceurl otherwise
  • Loading branch information
tkempf committed Aug 26, 2015
1 parent 346ace7 commit 0d7649f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/com_finder/views/search/tmpl/default_form.php
Expand Up @@ -39,10 +39,11 @@
if ($this->params->get('show_autosuggest', 1))
{
JHtml::_('script', 'media/jui/js/jquery.autocomplete.min.js', false, false, false, false, true);

$filter = ($params->get('searchfilter')!='') ? '&f=' . $params->get('searchfilter') : '';

$script .= "
var suggest = jQuery('#q').autocomplete({
serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component&f=' . $params->get('searchfilter'), false) . "',
serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component' . $filter, false) . "',
paramName: 'q',
minChars: 1,
maxHeight: 400,
Expand Down

0 comments on commit 0d7649f

Please sign in to comment.