]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 695514: Slow performance in field-events.js.tmpl on show_bug.cgi with large numbe...
authorFrédéric Buclin <LpSolit@gmail.com>
Tue, 28 Feb 2012 22:26:33 +0000 (23:26 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 28 Feb 2012 22:26:33 +0000 (23:26 +0100)
r=dkl a=LpSolit

template/en/default/bug/create/create.html.tmpl
template/en/default/bug/field-events.js.tmpl
template/en/default/bug/field.html.tmpl

index 58fb0c937346439b2442e173dfa965c8ee443f99..3b46ba40fb46b656dfe4b5645c5ac32d4fca4a26 100644 (file)
@@ -231,7 +231,7 @@ TUI_hide_default('attachment_text_field');
       <script type="text/javascript">
        <!--
          [%+ INCLUDE "bug/field-events.js.tmpl" 
-                    field = bug_fields.component %]
+                     field = bug_fields.component, product = product %]
        //-->
        </script>
     </td>
index fa805b528d6f2dcdac3842e61eed6f3f3a981935..003391c34c6c29da3638c326344d0485117b9671 100644 (file)
@@ -8,6 +8,8 @@
 
 [%# INTERFACE:
   #   field: a Bugzilla::Field object
+  #   product: (optional) a Bugzilla::Product object. When specified,
+  #            components are restricted to this product.
   #%]
 
 [% FOREACH controlled_field = field.controls_visibility_of %]
   [%- END %]
   ]);
 [% END %]
-[% FOREACH legal_value = field.legal_values %]
+
+[% legal_values = [] %]
+[% IF field.name == "component" AND product %]
+  [% legal_values = product.components %]
+[% ELSE %]
+  [% legal_values = field.legal_values %]
+[% END %]
+
+[% FOREACH legal_value = legal_values %]
   [% FOREACH controlled_field = legal_value.controlled_values.keys %]
     [% SET cont_ids = [] %]
     [% FOREACH val = legal_value.controlled_values.$controlled_field %]
index 12f1bb7f942891cc778298257a2da2babf928fa9..78e919a2d1ac0d23ff7ddb9722de62e53a6da750 100644 (file)
         <script type="text/javascript">
         <!--
           initHidingOptionsForIE('[% field.name FILTER js %]');
-          [%+ INCLUDE "bug/field-events.js.tmpl" field = field %]
+          [%+ INCLUDE "bug/field-events.js.tmpl"
+                      field = field, product = bug.product_obj %]
         //-->
         </script>