diff options
author | Byron Jones <bjones@mozilla.com> | 2012-06-15 11:57:34 +0200 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2012-06-15 11:57:34 +0200 |
commit | 49a634c18da85036a0850c7854545f36b73dc560 (patch) | |
tree | 0144700e736ead7c61e968898f1617eef86e1e8f /template/en/default | |
parent | cc8094d001ab16e015cd75e29e6d335cf29b1a5b (diff) | |
download | bugzilla-49a634c18da85036a0850c7854545f36b73dc560.tar.gz bugzilla-49a634c18da85036a0850c7854545f36b73dc560.tar.xz |
Better fix instant search crashing when a product is not pre-selected
Diffstat (limited to 'template/en/default')
-rw-r--r-- | template/en/default/search/search-instant.html.tmpl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/template/en/default/search/search-instant.html.tmpl b/template/en/default/search/search-instant.html.tmpl index c14b681b1..9803dc9e1 100644 --- a/template/en/default/search/search-instant.html.tmpl +++ b/template/en/default/search/search-instant.html.tmpl @@ -15,7 +15,9 @@ yui = [ 'datatable', 'container' ] %] -[% default.product.push('Firefox') UNLESS default.product.size %] +[% UNLESS default.exists('product') && default.product.size %] + [% default.product = [ 'Firefox' ] %] +[% END %] <script> YAHOO.bugzilla.instantSearch.setLabels( { @@ -46,7 +48,7 @@ YAHOO.bugzilla.instantSearch.setLabels( { [% FOREACH p = user.get_selectable_products(c.id) %] [% IF p.components.size %] <option value="[% p.name FILTER html %]" - [% " selected" IF default.product && lsearch(default.product, p.name) != -1 %]> + [% " selected" IF lsearch(default.product, p.name) != -1 %]> [% p.name FILTER html %] </option> [% END %] @@ -56,7 +58,7 @@ YAHOO.bugzilla.instantSearch.setLabels( { [% ELSE %] [% FOREACH p = product %] <option value="[% p.name FILTER html %]" - [% " selected" IF default.product && lsearch(default.product, p.name) != -1 %]> + [% " selected" IF lsearch(default.product, p.name) != -1 %]> [% p.name FILTER html %] </option> [% END %] |