]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 309167: change to product which has same component name results in no prompt...
authorolav%bkor.dhs.org <>
Sun, 5 Nov 2006 08:27:09 +0000 (08:27 +0000)
committerolav%bkor.dhs.org <>
Sun, 5 Nov 2006 08:27:09 +0000 (08:27 +0000)
Patch by Olav Vitters <olav@bkor.dhs.org> r=LpSolit a=myk

process_bug.cgi
template/en/default/bug/process/verify-new-product.html.tmpl
template/en/default/global/select-menu.html.tmpl

index 33a5c75ecd2987e162adff337c91b8c52defe6ed..d3f52641e436d3026e349f878b3d9425ca2810c4 100755 (executable)
@@ -374,11 +374,14 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct)
        $mok = lsearch(\@milestone_names, $cgi->param('target_milestone')) >= 0;
     }
 
-    # If the product-specific fields need to be verified, or we need to verify
-    # whether or not to add the bugs to their new product's group, display
-    # a verification form.
-    if (!$vok || !$cok || !$mok || (AnyDefaultGroups()
-        && !defined $cgi->param('addtonewgroup'))) {
+    # We cannot be sure if the component is the same by only checking $cok; the
+    # current component name could exist in the new product. So always display
+    # the form and use the confirm_product_change param to check if that was
+    # shown. Also show the verification form if the product-specific fields
+    # somehow still need to be verified, or if we need to verify whether or not
+    # to add the bugs to their new product's group.
+    if (!$vok || !$cok || !$mok || !defined $cgi->param('confirm_product_change')
+        || (AnyDefaultGroups() && !defined $cgi->param('addtonewgroup'))) {
 
         if (Bugzilla->usage_mode == USAGE_MODE_EMAIL) {
             if (!$vok) {
@@ -398,7 +401,9 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct)
             }
         }
         
-        if (!$vok || !$cok || !$mok) {
+        if (!$vok || !$cok || !$mok
+            || !defined $cgi->param('confirm_product_change'))
+        {
             $vars->{'verify_fields'} = 1;
             my %defaults;
             # We set the defaults to these fields to the old value,
index 3b185993b0c38bfe9f117dd157c5b7ea81dd5489..9b73abe97645fb895f9c58dd80cdf772dcc2a779 100644 (file)
@@ -47,6 +47,7 @@
 [% PROCESS "global/hidden-fields.html.tmpl"
      exclude=(verify_fields ? "^version|component|target_milestone$" : "") %]
 
+<input type="hidden" name="confirm_product_change" value="1">
 [%# Verify the version, component, and target milestone fields. %]
 [% IF verify_fields %]
   <h3>Verify Version, Component[% ", Target Milestone" IF use_target_milestone %]</h3>
     <tr>
       <td>
         <b>Version:</b><br>
-        [% PROCESS "global/select-menu.html.tmpl" name="version" options=versions default=defaults.version %]
+        [% PROCESS "global/select-menu.html.tmpl" 
+                   name="version"
+                   options=versions
+                   default=defaults.version
+                   size=10 %]
       </td>
       <td>
         <b>Component:</b><br>
-        [% PROCESS "global/select-menu.html.tmpl" name="component" options=components default=defaults.component %]
+        [% PROCESS "global/select-menu.html.tmpl"
+                   name="component"
+                   options=components
+                   default=defaults.component
+                   size=10 %]
       </td>
       [% IF use_target_milestone %]
         <td>
           <b>Target Milestone:</b><br>
-        [% PROCESS "global/select-menu.html.tmpl" name="target_milestone" options=milestones default=defaults.target_milestone %]
+        [% PROCESS "global/select-menu.html.tmpl"
+                   name="target_milestone"
+                   options=milestones
+                   default=defaults.target_milestone
+                   size=10 %]
         </td>
       [% END %]
     </tr>
index 725ec88dd1649bd80cbf58e3bc202ea11b56226b..3233ad77620339998010b0ea0568f5a8ce442f50 100644 (file)
@@ -24,7 +24,7 @@
   #
   # multiple: boolean; whether or not the menu is multi-select
   #
-  # size: integer; if multi-select, the number of items to display at once
+  # size: integer; the number of items to display at once
   # 
   # options: array or hash; the items with which to populate the array.
   #   If a hash is passed, the hash keys become the names displayed
@@ -45,7 +45,8 @@
 
 <select name="[% name FILTER html %]" 
         [% IF onchange %]onchange="[% onchange FILTER html %]"[% END %]
-        [% IF multiple %] multiple [% IF size %] size="[% size %]" [% END %] [% END %]>
+        [% IF multiple %] multiple [% END %]
+        [% IF size %] size="[% size %]" [% END %]>
   [% IF options_type.search("ARRAY") %]
     [% FOREACH value = options %]
       <option value="[% value FILTER html %]"