@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.

Fix an issue where some Differential edit pathways may not have reviewers attached

Summary:
Depends on D19021. Ref T13053. When you "Subscribe", or make some other types of edits, we don't necessarily have reviewer data, but may now need it to do the new recipient list logic.

I don't have a totally clean way to deal with this in the general case in mind, but just load it for now so that things don't fatal.

Test Plan: Subscribed to a revision with the "Subscribe" action.

Reviewers: amckinley

Maniphest Tasks: T13053

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

+29
+25
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 632 632 } 633 633 634 634 protected function getMailTo(PhabricatorLiskDAO $object) { 635 + $this->requireReviewers($object); 636 + 635 637 $phids = array(); 636 638 $phids[] = $object->getAuthorPHID(); 637 639 foreach ($object->getReviewers() as $reviewer) { ··· 645 647 } 646 648 647 649 protected function newMailUnexpandablePHIDs(PhabricatorLiskDAO $object) { 650 + $this->requireReviewers($object); 651 + 648 652 $phids = array(); 649 653 650 654 foreach ($object->getReviewers() as $reviewer) { ··· 1736 1740 $revision->setRemovedLineCount((int)$row['D']); 1737 1741 } 1738 1742 } 1743 + 1744 + private function requireReviewers(DifferentialRevision $revision) { 1745 + if ($revision->hasAttachedReviewers()) { 1746 + return; 1747 + } 1748 + 1749 + $with_reviewers = id(new DifferentialRevisionQuery()) 1750 + ->setViewer($this->getActor()) 1751 + ->needReviewers(true) 1752 + ->withPHIDs(array($revision->getPHID())) 1753 + ->executeOne(); 1754 + if (!$with_reviewers) { 1755 + throw new Exception( 1756 + pht( 1757 + 'Failed to reload revision ("%s").', 1758 + $revision->getPHID())); 1759 + } 1760 + 1761 + $revision->attachReviewers($with_reviewers->getReviewers()); 1762 + } 1763 + 1739 1764 1740 1765 }
+4
src/applications/differential/storage/DifferentialRevision.php
··· 583 583 return $this; 584 584 } 585 585 586 + public function hasAttachedReviewers() { 587 + return ($this->reviewerStatus !== self::ATTACHABLE); 588 + } 589 + 586 590 public function getReviewerPHIDs() { 587 591 $reviewers = $this->getReviewers(); 588 592 return mpull($reviewers, 'getReviewerPHID');