Commit e6f4f6c7 authored by travis%sedsystems.ca's avatar travis%sedsystems.ca

Bug 212940 : Can't use an undefined value as an ARRAY reference at…

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
parent 8b4d0095
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
# Dave Miller <justdave@syndicomm.com> # Dave Miller <justdave@syndicomm.com>
# Christopher Aillon <christopher@aillon.com> # Christopher Aillon <christopher@aillon.com>
# Myk Melez <myk@mozilla.org> # Myk Melez <myk@mozilla.org>
# Frédéric Buclin <LpSolit@netscape.net> # Frédéric Buclin <LpSolit@gmail.com>
use strict; use strict;
...@@ -908,11 +908,8 @@ SWITCH: for ($::FORM{'knob'}) { ...@@ -908,11 +908,8 @@ SWITCH: for ($::FORM{'knob'}) {
/^accept$/ && CheckonComment( "accept" ) && do { /^accept$/ && CheckonComment( "accept" ) && do {
DoConfirm(); DoConfirm();
ChangeStatus('ASSIGNED'); ChangeStatus('ASSIGNED');
if (Param("musthavemilestoneonaccept") && if (Param("usetargetmilestone") && Param("musthavemilestoneonaccept")) {
scalar(@{$::target_milestone{$::FORM{'product'}}}) > 1) { $requiremilestone = 1;
if (Param("usetargetmilestone")) {
$requiremilestone = 1;
}
} }
last SWITCH; last SWITCH;
}; };
...@@ -1249,14 +1246,23 @@ foreach my $id (@idlist) { ...@@ -1249,14 +1246,23 @@ foreach my $id (@idlist) {
{ product => $::FORM{'product'} }, "abort"); { product => $::FORM{'product'} }, "abort");
} }
if ($requiremilestone) { if ($requiremilestone) {
my $value = $::FORM{'target_milestone'}; # musthavemilestoneonaccept applies only if at least two
if (!defined $value || $value eq $::FORM{'dontchange'}) { # target milestones are defined for the current product.
$value = $oldhash{'target_milestone'}; my $nb_milestones = scalar(@{$::target_milestone{$oldhash{'product'}}});
} if ($nb_milestones > 1) {
SendSQL("SELECT defaultmilestone FROM products WHERE name = " . my $value = $cgi->param('target_milestone');
SqlQuote($oldhash{'product'})); if (!defined $value || $value eq $cgi->param('dontchange')) {
if ($value eq FetchOneColumn()) { $value = $oldhash{'target_milestone'};
ThrowUserError("milestone_required", { bug_id => $id }, "abort"); }
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) { if (defined $::FORM{'delta_ts'} && $::FORM{'delta_ts'} ne $delta_ts) {
......
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