summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-06-25 19:07:55 +0200
committerbbaetz%student.usyd.edu.au <>2002-06-25 19:07:55 +0200
commitb77ad821cb2fff20085e3d990148eec8b383df98 (patch)
tree4fdeb3339c1b36bb52f0b529fddb9b9e032af9c6 /process_bug.cgi
parent9f510268889a6ba3ec6da8bf022cc5627ec573d5 (diff)
downloadbugzilla-b77ad821cb2fff20085e3d990148eec8b383df98.tar.gz
bugzilla-b77ad821cb2fff20085e3d990148eec8b383df98.tar.xz
Bug 157085 - verify-new-product doesn't set defaults
r=jouni, gerv
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi21
1 files changed, 20 insertions, 1 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index db19916a3..103085457 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -191,16 +191,35 @@ if ((($::FORM{'id'} && $::FORM{'product'} ne $::oldproduct)
if (!$vok || !$cok || !$mok) {
$vars->{'verify_fields'} = 1;
+ my %defaults;
+ # We set the defaults to these fields to the old value,
+ # if its a valid option, otherwise we use the default where
+ # thats appropriate
$vars->{'versions'} = $::versions{$prod};
+ if (lsearch($::versions{$prod}, $::FORM{'version'}) != -1) {
+ $defaults{'version'} = $::FORM{'version'};
+ }
$vars->{'components'} = $::components{$prod};
-
+ if (lsearch($::components{$prod}, $::FORM{'component'}) != -1) {
+ $defaults{'component'} = $::FORM{'component'};
+ }
+
if (Param("usetargetmilestone")) {
$vars->{'use_target_milestone'} = 1;
$vars->{'milestones'} = $::target_milestone{$prod};
+ if (lsearch($::target_milestone{$prod},
+ $::FORM{'target_milestone'}) != -1) {
+ $defaults{'target_milestone'} = $::FORM{'target_milestone'};
+ } else {
+ SendSQL("SELECT defaultmilestone FROM products WHERE " .
+ "product = " . SqlQuote($prod));
+ $defaults{'target_milestone'} = FetchOneColumn();
+ }
}
else {
$vars->{'use_target_milestone'} = 0;
}
+ $vars->{'defaults'} = \%defaults;
}
else {
$vars->{"verify_fields"} = 0;