Page MenuHomePhabricator

D14694.id35537.diff
No OneTemporary

D14694.id35537.diff

diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php
--- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php
+++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php
@@ -748,6 +748,10 @@
protected function expandTransactions(
PhabricatorLiskDAO $object,
array $xactions) {
+
+ $actor = $this->getActor();
+ $actor_phid = $actor->getPHID();
+
$results = parent::expandTransactions($object, $xactions);
$is_unassigned = ($object->getOwnerPHID() === null);
@@ -781,8 +785,6 @@
// being closed, try to assign the actor as the owner.
if ($is_unassigned && !$any_assign && $is_open && $is_closing) {
// Don't assign the actor if they aren't a real user.
- $actor = $this->getActor();
- $actor_phid = $actor->getPHID();
if ($actor_phid) {
$results[] = id(new ManiphestTransaction())
->setTransactionType(ManiphestTransaction::TYPE_OWNER)
@@ -790,6 +792,18 @@
}
}
+ // Automatically subscribe the author when they create a task.
+ if ($this->getIsNewObject()) {
+ if ($actor_phid) {
+ $results[] = id(new ManiphestTransaction())
+ ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS)
+ ->setNewValue(
+ array(
+ '+' => array($actor_phid => $actor_phid),
+ ));
+ }
+ }
+
return $results;
}

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 7, 6:36 PM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7712228
Default Alt Text
D14694.id35537.diff (1 KB)

Event Timeline