diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 2ec8133035..2c9f872e13 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -994,6 +994,8 @@ sub create { 'feature_enabled' => sub { return Bugzilla->feature(@_); }, + 'has_extension' => sub { return Bugzilla->has_extension(@_); }, + # field_descs can be somewhat slow to generate, so we generate # it only once per-language no matter how many times # $template->process() is called. diff --git a/js/instant-search.js b/js/instant-search.js index 946f8ccfc2..a82a6388b1 100644 --- a/js/instant-search.js +++ b/js/instant-search.js @@ -138,7 +138,7 @@ YAHOO.bugzilla.instantSearch = { YAHOO.bugzilla.instantSearch.dataTable.showTableMessage( 'Searching...   ' + - '', YAHOO.widget.DataTable.CLASS_LOADING ); @@ -189,7 +189,7 @@ YAHOO.bugzilla.instantSearch = { var result = []; var name = Dom.get('product').value; result.push(name); - if (products[name] && products[name].related) { + if (typeof products !== 'undefined' && products[name] && products[name].related) { for (var i = 0, n = products[name].related.length; i < n; i++) { result.push(products[name].related[i]); } diff --git a/template/en/default/search/search-instant.html.tmpl b/template/en/default/search/search-instant.html.tmpl index d0cf078e7e..ed39421667 100644 --- a/template/en/default/search/search-instant.html.tmpl +++ b/template/en/default/search/search-instant.html.tmpl @@ -8,11 +8,15 @@ [% PROCESS global/variables.none.tmpl %] +[% javascript_urls = [ 'js/instant-search.js' ] %] +[% IF has_extension('GuidedBugEntry') %] + [% javascript_urls.import(['extensions/GuidedBugEntry/web/js/products.js']); %] +[% END %] + [% PROCESS global/header.html.tmpl title = "Instant Search" generate_api_token = 1 - javascript_urls = [ 'extensions/GuidedBugEntry/web/js/products.js', - 'js/instant-search.js', ] + javascript_urls = javascript_urls %] [% UNLESS default.exists('product') && default.product.size %]