summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authortravis%sedsystems.ca <>2005-02-24 01:53:24 +0100
committertravis%sedsystems.ca <>2005-02-24 01:53:24 +0100
commite6f4f6c720488c19d06aa5854cb13cf124687627 (patch)
treef6013ca6f2482e74f1839b956b2012c5628c5920 /process_bug.cgi
parent8b4d0095a9a2c3e5543122ccb3fea24d72d094f1 (diff)
downloadbugzilla-e6f4f6c720488c19d06aa5854cb13cf124687627.tar.gz
bugzilla-e6f4f6c720488c19d06aa5854cb13cf124687627.tar.xz
Bug 212940 : Can't use an undefined value as an ARRAY reference at /http/bugzilla/process_bug.cgi line 866.
Patch by Frederic Buclin <LpSolit@gmail.com> r=wurblzap a=justdave
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi34
1 files changed, 20 insertions, 14 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index b742062dd..c1f3c33bb 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -23,7 +23,7 @@
# Dave Miller <justdave@syndicomm.com>
# Christopher Aillon <christopher@aillon.com>
# Myk Melez <myk@mozilla.org>
-# Frédéric Buclin <LpSolit@netscape.net>
+# Frédéric Buclin <LpSolit@gmail.com>
use strict;
@@ -908,11 +908,8 @@ SWITCH: for ($::FORM{'knob'}) {
/^accept$/ && CheckonComment( "accept" ) && do {
DoConfirm();
ChangeStatus('ASSIGNED');
- if (Param("musthavemilestoneonaccept") &&
- scalar(@{$::target_milestone{$::FORM{'product'}}}) > 1) {
- if (Param("usetargetmilestone")) {
- $requiremilestone = 1;
- }
+ if (Param("usetargetmilestone") && Param("musthavemilestoneonaccept")) {
+ $requiremilestone = 1;
}
last SWITCH;
};
@@ -1249,14 +1246,23 @@ foreach my $id (@idlist) {
{ product => $::FORM{'product'} }, "abort");
}
if ($requiremilestone) {
- my $value = $::FORM{'target_milestone'};
- if (!defined $value || $value eq $::FORM{'dontchange'}) {
- $value = $oldhash{'target_milestone'};
- }
- SendSQL("SELECT defaultmilestone FROM products WHERE name = " .
- SqlQuote($oldhash{'product'}));
- if ($value eq FetchOneColumn()) {
- ThrowUserError("milestone_required", { bug_id => $id }, "abort");
+ # musthavemilestoneonaccept applies only if at least two
+ # target milestones are defined for the current product.
+ my $nb_milestones = scalar(@{$::target_milestone{$oldhash{'product'}}});
+ if ($nb_milestones > 1) {
+ my $value = $cgi->param('target_milestone');
+ if (!defined $value || $value eq $cgi->param('dontchange')) {
+ $value = $oldhash{'target_milestone'};
+ }
+ my $defaultmilestone =
+ $dbh->selectrow_array("SELECT defaultmilestone
+ FROM products WHERE id = ?",
+ undef, $oldhash{'product_id'});
+ # if musthavemilestoneonaccept == 1, then the target
+ # milestone must be different from the default one.
+ if ($value eq $defaultmilestone) {
+ ThrowUserError("milestone_required", { bug_id => $id }, "abort");
+ }
}
}
if (defined $::FORM{'delta_ts'} && $::FORM{'delta_ts'} ne $delta_ts) {