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 @@ -327,11 +327,11 @@ $is_unassigned = ($object->getOwnerPHID() === null); - $any_assign = false; + $any_xassign = null; foreach ($xactions as $xaction) { if ($xaction->getTransactionType() == ManiphestTaskOwnerTransaction::TRANSACTIONTYPE) { - $any_assign = true; + $any_xassign = $xaction; break; } } @@ -353,17 +353,26 @@ $is_closing = ManiphestTaskStatus::isClosedStatus($new_status); } + // Automatically claim the task if the status is configured as such. // If the task is not assigned, not being assigned, currently open, and // being closed, try to assign the actor as the owner. - if ($is_unassigned && !$any_assign && $is_open && $is_closing) { - $is_claim = ManiphestTaskStatus::isClaimStatus($new_status); - - // Don't assign the actor if they aren't a real user. - // Don't claim the task if the status is configured to not claim. - if ($actor_phid && $is_claim) { + // Don't assign the actor if they aren't a real user. + $is_claim = ManiphestTaskStatus::isClaimStatus($new_status); + if ($is_unassigned && $is_open && $is_closing && $is_claim && $actor_phid) { + if ($any_xassign === null) { + // Green light for automatic auto-claim since nothing is manually set. $results[] = id(new ManiphestTransaction()) ->setTransactionType(ManiphestTaskOwnerTransaction::TRANSACTIONTYPE) ->setNewValue($actor_phid); + } else if ($any_xassign->getNewValue() === null) { + // We have an explicit <"Assign / Claim" = nothing> in the frontend. + // The user has probably tried to "undo" the above automatic auto-claim. + // When saving, this would cause the "no effect" warning. + // So we suppress that confusing warning. + // https://we.phorge.it/T15164 + if ($any_xassign->getNewValue() === null) { + $any_xassign->setIgnoreOnNoEffect(true); + } } }