@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 "Author's projects" Herald rules for revisions and diffs

Summary:
See PHI71. These didn't get properly updated when we wrote Subprojects and Milestones, and should use materialized members, not raw members. Swap the query so projects you are an indirect member of (e.g., milestones you are a member of the parent for, and parent projects you are a member of a subproject of) are included in the result list.

Also fix a bad typeahead datasource.

Test Plan:
- Ran a dry run with the test console, saw project PHIDs for milestones and parent projects in the raw field value.
- Tried to set "Author's projects" to a user, no longer could.

Reviewers: amckinley

Reviewed By: amckinley

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

+17 -7
+9 -4
src/applications/differential/herald/DifferentialDiffAuthorProjectsHeraldField.php
··· 10 10 } 11 11 12 12 public function getHeraldFieldValue($object) { 13 - return PhabricatorEdgeQuery::loadDestinationPHIDs( 14 - $object->getAuthorPHID(), 15 - PhabricatorProjectMemberOfProjectEdgeType::EDGECONST); 13 + $viewer = PhabricatorUser::getOmnipotentUser(); 14 + 15 + $projects = id(new PhabricatorProjectQuery()) 16 + ->setViewer($viewer) 17 + ->withMemberPHIDs(array($object->getAuthorPHID())) 18 + ->execute(); 19 + 20 + return mpull($projects, 'getPHID'); 16 21 } 17 22 18 23 protected function getHeraldFieldStandardType() { ··· 20 25 } 21 26 22 27 protected function getDatasource() { 23 - return new PhabricatorProjectOrUserDatasource(); 28 + return new PhabricatorProjectDatasource(); 24 29 } 25 30 26 31 }
+8 -3
src/applications/differential/herald/DifferentialRevisionAuthorProjectsHeraldField.php
··· 10 10 } 11 11 12 12 public function getHeraldFieldValue($object) { 13 - return PhabricatorEdgeQuery::loadDestinationPHIDs( 14 - $object->getAuthorPHID(), 15 - PhabricatorProjectMemberOfProjectEdgeType::EDGECONST); 13 + $viewer = PhabricatorUser::getOmnipotentUser(); 14 + 15 + $projects = id(new PhabricatorProjectQuery()) 16 + ->setViewer($viewer) 17 + ->withMemberPHIDs(array($object->getAuthorPHID())) 18 + ->execute(); 19 + 20 + return mpull($projects, 'getPHID'); 16 21 } 17 22 18 23 protected function getHeraldFieldStandardType() {