]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1555409 - D32774 not moved out of Draft state
authordklawren <dklawren@users.noreply.github.com>
Wed, 5 Jun 2019 20:38:24 +0000 (16:38 -0400)
committerGitHub <noreply@github.com>
Wed, 5 Jun 2019 20:38:24 +0000 (16:38 -0400)
extensions/PhabBugz/lib/Feed.pm
extensions/PhabBugz/lib/Revision.pm

index cbca9ae28a36222b081a1f2e99a7df611e0064d5..c99c01bc45906a36b33bac8df85181e85424910b 100644 (file)
@@ -508,8 +508,12 @@ sub process_revision_change {
     $attachment->update($timestamp);
   }
 
-  # Set status to request-review if revision is new and in draft state
-  if ($is_new && $revision->status eq 'draft') {
+  # Set status to request-review if revision is new and
+  # in draft state and not changes-planned
+  if ($is_new
+      && $revision->status ne 'changes-planned'
+      && ($revision->is_draft && !$revision->hold_as_draft))
+  {
     INFO("Moving from draft to needs-review");
     $revision->set_status('request-review');
   }
index 4c6338b5c2fcdd87d5e471149a2284e7ff50d924..3ec844aff51678bf0c32e65076d654f7cb23144e 100644 (file)
@@ -33,6 +33,8 @@ has phid             => (is => 'ro',   isa => Str);
 has title            => (is => 'ro',   isa => Str);
 has summary          => (is => 'ro',   isa => Str);
 has status           => (is => 'ro',   isa => Str);
+has is_draft         => (is => 'ro',   isa => Bool | JSONBool);
+has hold_as_draft    => (is => 'ro',   isa => Bool | JSONBool);
 has creation_ts      => (is => 'ro',   isa => Str);
 has modification_ts  => (is => 'ro',   isa => Str);
 has author_phid      => (is => 'ro',   isa => Str);
@@ -105,6 +107,8 @@ sub BUILDARGS {
   $params->{title}           = $params->{fields}->{title};
   $params->{summary}         = $params->{fields}->{summary};
   $params->{status}          = $params->{fields}->{status}->{value};
+  $params->{is_draft}        = $params->{fields}->{isDraft};
+  $params->{hold_as_draft}   = $params->{fields}->{holdAsDraft};
   $params->{creation_ts}     = $params->{fields}->{dateCreated};
   $params->{modification_ts} = $params->{fields}->{dateModified};
   $params->{author_phid}     = $params->{fields}->{authorPHID};