From: Hugo Date: Sat, 1 Dec 2012 15:11:01 +0000 (+0100) Subject: Bug 812054: JavaScript error on the Advanced Search page when a classification has... X-Git-Tag: bugzilla-4.4rc2~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ae8a6e46be3aa8de7a3869434deb8fe895dff33;p=thirdparty%2Fbugzilla.git Bug 812054: JavaScript error on the Advanced Search page when a classification has a product invisible to the user r/a=LpSolit --- diff --git a/template/en/default/search/field.html.tmpl b/template/en/default/search/field.html.tmpl index 34a480f315..ab73808571 100644 --- a/template/en/default/search/field.html.tmpl +++ b/template/en/default/search/field.html.tmpl @@ -158,10 +158,21 @@ }); [% SET sub_field = value_controllers.${field.name}.$accessor %] + [% SET prod_per_class = {} %] + [% IF field.name == "classification" %] + [% FOREACH p = product %] + [% prod_per_class.${p.classification_id}.${p.id} = 1 %] + [% END %] + [% END %] + [% FOREACH legal_value = legal_values %] [% SET controlled_ids = [] %] - [% FOREACH sub_value = legal_value.$accessor %] - [% controlled_ids.push(sub_value.id) %] + [% IF field.name == "classification" %] + [% controlled_ids = prod_per_class.${legal_value.id}.keys %] + [% ELSE %] + [% FOREACH sub_value = legal_value.$accessor %] + [% controlled_ids.push(sub_value.id) %] + [% END %] [% END %] [% NEXT IF !controlled_ids.size %] showValueWhen('[% sub_field.name FILTER js %]',