Commit 6ae8a6e4 authored by Hugo's avatar Hugo Committed by Frédéric Buclin

Bug 812054: JavaScript error on the Advanced Search page when a classification…

Bug 812054: JavaScript error on the Advanced Search page when a classification has a product invisible to the user r/a=LpSolit
parent 09b06e0d
...@@ -158,10 +158,21 @@ ...@@ -158,10 +158,21 @@
}); });
[% SET sub_field = value_controllers.${field.name}.$accessor %] [% 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 %] [% FOREACH legal_value = legal_values %]
[% SET controlled_ids = [] %] [% SET controlled_ids = [] %]
[% FOREACH sub_value = legal_value.$accessor %] [% IF field.name == "classification" %]
[% controlled_ids.push(sub_value.id) %] [% controlled_ids = prod_per_class.${legal_value.id}.keys %]
[% ELSE %]
[% FOREACH sub_value = legal_value.$accessor %]
[% controlled_ids.push(sub_value.id) %]
[% END %]
[% END %] [% END %]
[% NEXT IF !controlled_ids.size %] [% NEXT IF !controlled_ids.size %]
showValueWhen('[% sub_field.name FILTER js %]', showValueWhen('[% sub_field.name FILTER js %]',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment