diff options
author | Hugo <hugo.seabrook@gmail.com> | 2012-12-01 16:09:52 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2012-12-01 16:09:52 +0100 |
commit | ca9a9be386bd21415245937fbb110d706e1a5d05 (patch) | |
tree | c56c29222ce3b38dd0a706d55b191dac96723734 /template/en/default/search/field.html.tmpl | |
parent | 809b353e8bfb0e0f6deff421eb391a824812857d (diff) | |
download | bugs-ca9a9be386bd21415245937fbb110d706e1a5d05.tar bugs-ca9a9be386bd21415245937fbb110d706e1a5d05.tar.gz bugs-ca9a9be386bd21415245937fbb110d706e1a5d05.tar.bz2 bugs-ca9a9be386bd21415245937fbb110d706e1a5d05.tar.xz bugs-ca9a9be386bd21415245937fbb110d706e1a5d05.zip |
Bug 812054: JavaScript error on the Advanced Search page when a classification has a product invisible to the user
r/a=LpSolit
Diffstat (limited to 'template/en/default/search/field.html.tmpl')
-rw-r--r-- | template/en/default/search/field.html.tmpl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/template/en/default/search/field.html.tmpl b/template/en/default/search/field.html.tmpl index 34a480f31..ab7380857 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 %]', |