diff --git a/src/applications/phortune/editor/PhortuneAccountEditor.php b/src/applications/phortune/editor/PhortuneAccountEditor.php index 50a71c476f..8344bc2b6e 100644 --- a/src/applications/phortune/editor/PhortuneAccountEditor.php +++ b/src/applications/phortune/editor/PhortuneAccountEditor.php @@ -1,82 +1,82 @@ requireActor(); switch ($type) { case PhabricatorTransactions::TYPE_EDGE: foreach ($xactions as $xaction) { switch ($xaction->getMetadataValue('edge:type')) { case PhortuneAccountHasMemberEdgeType::EDGECONST: $old = $object->getMemberPHIDs(); $new = $this->getPHIDTransactionNewValue($xaction, $old); $old = array_fuse($old); $new = array_fuse($new); foreach ($new as $new_phid) { if (isset($old[$new_phid])) { continue; } $user = id(new PhabricatorPeopleQuery()) ->setViewer($viewer) ->withPHIDs(array($new_phid)) ->executeOne(); if (!$user) { $error = new PhabricatorApplicationTransactionValidationError( $type, pht('Invalid'), pht( 'Account managers must be valid users, "%s" is not.', $new_phid)); $errors[] = $error; continue; } } $actor_phid = $this->getActingAsPHID(); - if (!isset($new[$actor_phid])) { + if (isset($old[$actor_phid]) && !isset($new[$actor_phid])) { $error = new PhabricatorApplicationTransactionValidationError( $type, pht('Invalid'), pht('You can not remove yourself as an account manager.'), $xaction); $errors[] = $error; } break; } } break; } return $errors; } }