Commit ca9a9be3 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 809b353e
......@@ -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 %]',
......
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