@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

In Maniphest tasks, only move old owner to CC if owner changed

Summary:
Fixes T10426. When the owner of a task changes, we try to add the old owner to CC so they're kept in the loop.

Currently, we do this unconditionally. This can add the owner as a subscriber when someone didn't change anything, which is confusing.

Instead, only do this if the owner actually changed.

Test Plan:
- With "A" as owner, edited task and saved.
- Before patch, A was added as subscriber.
- After patch, A not added.
- With "A" as owner, changed owner to "B" and saved.
- Both before and after patch, "A" is added as a subscriber.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10426

Differential Revision: https://secure.phabricator.com/D15333

+9 -3
+9 -3
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 1033 1033 )); 1034 1034 break; 1035 1035 case ManiphestTransaction::TYPE_OWNER: 1036 + // If this is a no-op update, don't expand it. 1037 + $old_value = $object->getOwnerPHID(); 1038 + $new_value = $xaction->getNewValue(); 1039 + if ($old_value === $new_value) { 1040 + continue; 1041 + } 1042 + 1036 1043 // When a task is reassigned, move the old owner to the subscriber 1037 1044 // list so they're still in the loop. 1038 - $owner_phid = $object->getOwnerPHID(); 1039 - if ($owner_phid) { 1045 + if ($old_value) { 1040 1046 $results[] = id(new ManiphestTransaction()) 1041 1047 ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) 1042 1048 ->setIgnoreOnNoEffect(true) 1043 1049 ->setNewValue( 1044 1050 array( 1045 - '+' => array($owner_phid => $owner_phid), 1051 + '+' => array($old_value => $old_value), 1046 1052 )); 1047 1053 } 1048 1054 break;