From: David Lawrence Date: Wed, 12 Oct 2016 15:53:54 +0000 (+0000) Subject: Bug 1305457 - product and component quick search does not work from describecomponent... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82c9e29116729ab27578a80ffb306abe107c0088;p=thirdparty%2Fbugzilla.git Bug 1305457 - product and component quick search does not work from describecomponents.cgi gives error if not logged in --- diff --git a/extensions/ProdCompSearch/web/js/prod_comp_search.js b/extensions/ProdCompSearch/web/js/prod_comp_search.js index efbaab81b..1b7e396a8 100644 --- a/extensions/ProdCompSearch/web/js/prod_comp_search.js +++ b/extensions/ProdCompSearch/web/js/prod_comp_search.js @@ -59,14 +59,17 @@ $(function() { $('.prod_comp_search') .each(function() { var that = $(this); + var params = { + limit: (that.data('max_results') + 1) + }; + if (BUGZILLA.api_token) { + params.Bugzilla_api_token = BUGZILLA.api_token; + } that.devbridgeAutocomplete({ serviceUrl: function(query) { return 'rest/prod_comp_search/' + encodeURIComponent(query); }, - params: { - Bugzilla_api_token: (BUGZILLA.api_token ? BUGZILLA.api_token : ''), - limit: (that.data('max_results') + 1) - }, + params: params, deferRequestBy: 250, minChars: 3, maxHeight: 500,