summaryrefslogtreecommitdiffstats
path: root/editvalues.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-07-13 20:10:39 +0200
committerlpsolit%gmail.com <>2007-07-13 20:10:39 +0200
commitff222adc4a6cb0349f7642d61bb63d2ff970607c (patch)
treeba87c96d90582e7740991bc2c65dba56c92ee76c /editvalues.cgi
parent012d45ae9579b0f1690a2daed8212f38e9c9e26a (diff)
downloadbugzilla-ff222adc4a6cb0349f7642d61bb63d2ff970607c.tar.gz
bugzilla-ff222adc4a6cb0349f7642d61bb63d2ff970607c.tar.xz
Bug 385415: Bugs marked as duplicate or moved to another installation always go to the RESOLVED state, even if the workflow has RESOLVED excluded from it (or if this bug status has been removed or renamed). Some major problems related to the workflow when upgrading or installing 3.1 are also fixed here - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
Diffstat (limited to 'editvalues.cgi')
-rwxr-xr-xeditvalues.cgi14
1 files changed, 10 insertions, 4 deletions
diff --git a/editvalues.cgi b/editvalues.cgi
index 3974d45dc..951078389 100755
--- a/editvalues.cgi
+++ b/editvalues.cgi
@@ -29,6 +29,7 @@ use Bugzilla::Config qw(:admin);
use Bugzilla::Token;
use Bugzilla::Field;
use Bugzilla::Bug;
+use Bugzilla::Status;
# List of different tables that contain the changeable field values
# (the old "enums.") Keep them in alphabetical order by their
@@ -136,7 +137,7 @@ $defaults{'bug_severity'} = 'defaultseverity';
# Alternatively, a list of non-editable values can be specified.
# In this case, only the sortkey can be altered.
my %static;
-$static{'bug_status'} = ['UNCONFIRMED'];
+$static{'bug_status'} = ['UNCONFIRMED', Bugzilla->params->{'duplicate_or_move_bug_status'}];
$static{'resolution'} = ['', 'FIXED', 'MOVED', 'DUPLICATE'];
$static{$_->name} = ['---'] foreach (@custom_fields);
@@ -234,9 +235,14 @@ if ($action eq 'new') {
$dbh->do("INSERT INTO $field (value, sortkey) VALUES (?, ?)",
undef, ($value, $sortkey));
- if ($field eq 'bug_status' && !$cgi->param('is_open')) {
- # The bug status is a closed state, but they are open by default.
- $dbh->do('UPDATE bug_status SET is_open = 0 WHERE value = ?', undef, $value);
+ if ($field eq 'bug_status') {
+ unless ($cgi->param('is_open')) {
+ # The bug status is a closed state, but they are open by default.
+ $dbh->do('UPDATE bug_status SET is_open = 0 WHERE value = ?', undef, $value);
+ }
+ # Allow the transition from this new bug status to the one used
+ # by the 'duplicate_or_move_bug_status' parameter.
+ Bugzilla::Status::add_missing_bug_status_transitions();
}
delete_token($token);