From e93a383f01ba32b3949e688b9f261ca57606d802 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 16 Apr 2014 18:27:09 +0000 Subject: Bug 994619 - show_bug product list is sometimes missing the actual product a bug is in r=gerv,a=justdave --- .../en/default/global/product-select.html.tmpl | 30 ++++++++++++++-------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'template/en/default/global') diff --git a/template/en/default/global/product-select.html.tmpl b/template/en/default/global/product-select.html.tmpl index 8e43c9d0e..ba5ce73b4 100644 --- a/template/en/default/global/product-select.html.tmpl +++ b/template/en/default/global/product-select.html.tmpl @@ -47,29 +47,39 @@ [% END %] [% IF Param('useclassification') %] - [% product_ids = {} %] + [% classifications = {} %] [% IF products %] [% FOREACH p = products %] - [% key = p.id -%] - [% product_ids.$key = p.id -%] + [% IF NOT classifications.${p.classification.name}.defined %] + [% classifications.${p.classification.name} = [] %] + [% END %] + [% classifications.${p.classification.name}.push(p) %] [% END %] - [% END %] - [% FOREACH c = user.get_selectable_classifications %] - + [% ELSE %] + [% FOREACH c = user.get_selectable_classifications %] + [% classifications.${c.name} = [] %] [% FOREACH p = user.get_selectable_products(c.id) %] - [% NEXT IF (products && ! product_ids.exists(p.id)) %] + [% classifications.${c.name}.push(p) %] + [% END %] + [% END %] + [% END %] + [% FOREACH c = classifications.keys.sort %] + + [% FOREACH p = classifications.$c %] [% END %] [% END %] [% ELSE %] - [% products = user.get_selectable_products UNLESS products %] + [% IF NOT products.defined %] + [% products = user.get_selectable_products %] + [% END %] [% FOREACH p = products %] [% END %] -- cgit v1.2.3-24-g4f1b