summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorFrank Becker <Frank@Frank-Becker.de>2012-08-18 23:34:52 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-08-18 23:34:52 +0200
commit6f5acec289dbde2acb35a032509d12e1a5f73b64 (patch)
treede039538488da76796bad4ec1e0aa553598e020d /Bugzilla
parentdaa75a7f360ce8fa3fd90d6a98277483d8b9ddd7 (diff)
downloadbugzilla-6f5acec289dbde2acb35a032509d12e1a5f73b64.tar.gz
bugzilla-6f5acec289dbde2acb35a032509d12e1a5f73b64.tar.xz
Bug 610581: The Bug.fields method doesn't include available bug statuses when creating a new bug
r/a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Status.pm4
-rw-r--r--Bugzilla/WebService/Bug.pm5
2 files changed, 7 insertions, 2 deletions
diff --git a/Bugzilla/Status.pm b/Bugzilla/Status.pm
index 1159fa4ae..2821f7c6e 100644
--- a/Bugzilla/Status.pm
+++ b/Bugzilla/Status.pm
@@ -175,8 +175,8 @@ sub _status_condition {
my ($self, $old_status) = @_;
my @values;
my $cond = 'old_status IS NULL';
- # For newly-filed bugs
- if ($old_status) {
+ # We may pass a fake status object to represent the initial unset state.
+ if ($old_status && $old_status->id) {
$cond = 'old_status = ?';
push(@values, $old_status->id);
}
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index faac5f3d6..ea5f82999 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -174,6 +174,11 @@ sub _legal_field_values {
elsif ($field_name eq 'bug_status') {
my @status_all = Bugzilla::Status->get_all;
+ my $initial_status = bless({ id => 0, name => '', is_open => 1, sortkey => 0,
+ can_change_to => Bugzilla::Status->can_change_to },
+ 'Bugzilla::Status');
+ unshift(@status_all, $initial_status);
+
foreach my $status (@status_all) {
my @can_change_to;
foreach my $change_to (@{ $status->can_change_to }) {