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

Remove loadMemberPHIDs from PhabricatorProject

Summary:
Ref T603. Move toward stamping out all the Project / ProjectProfile query irregularities with respect to policies.

- Fixes a bug with Asana publishing when the remote task is deleted.
- Fixes an issue with Herald commit rules.

Test Plan:
- Viewed projects;
- edited projects;
- added and removed members from projects;
- republished Asana-bridged feed stories about commits.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

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

+17 -15
+6 -1
src/applications/diffusion/doorkeeper/DiffusionDoorkeeperCommitFeedStoryPublisher.php
··· 83 83 $request_phids = PhabricatorOwnersOwner::loadAffiliatedUserPHIDs( 84 84 array($object->getID())); 85 85 } else if ($object instanceof PhabricatorProject) { 86 - $request_phids = $object->loadMemberPHIDs(); 86 + $project = id(new PhabricatorProjectQuery()) 87 + ->setViewer($this->getViewer()) 88 + ->withIDs(array($object->getID())) 89 + ->needMembers(true) 90 + ->executeOne(); 91 + $request_phids = $project->getMemberPHIDs(); 87 92 } else { 88 93 // Dunno what this is. 89 94 $request_phids = array();
+6 -2
src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php
··· 209 209 // Add the silent followers first so that a user who is both a reviewer and 210 210 // a CC gets silently added and then implicitly skipped by then noisy add. 211 211 // They will get a subtask notification. 212 - $this->addFollowers($oauth_token, $task_id, $silent_followers, true); 213 - $this->addFollowers($oauth_token, $task_id, $noisy_followers); 212 + 213 + // We only do this if the task still exists. 214 + if (empty($extra_data['gone'])) { 215 + $this->addFollowers($oauth_token, $task_id, $silent_followers, true); 216 + $this->addFollowers($oauth_token, $task_id, $noisy_followers); 217 + } 214 218 215 219 $dst_phid = $parent_ref->getExternalObject()->getPHID(); 216 220
+2
src/applications/herald/adapter/HeraldCommitAdapter.php
··· 150 150 151 151 $object = new HeraldCommitAdapter(); 152 152 153 + $commit->attachRepository($repository); 154 + 153 155 $object->repository = $repository; 154 156 $object->commit = $commit; 155 157 $object->commitData = $commit_data;
+2 -1
src/applications/project/controller/PhabricatorProjectMembersEditController.php
··· 16 16 $project = id(new PhabricatorProjectQuery()) 17 17 ->setViewer($user) 18 18 ->withIDs(array($this->id)) 19 + ->needMembers(true) 19 20 ->requireCapabilities( 20 21 array( 21 22 PhabricatorPolicyCapability::CAN_VIEW, ··· 30 31 $profile = new PhabricatorProjectProfile(); 31 32 } 32 33 33 - $member_phids = $project->loadMemberPHIDs(); 34 + $member_phids = $project->getMemberPHIDs(); 34 35 35 36 $errors = array(); 36 37 if ($request->isFormPost()) {
+1 -2
src/applications/project/editor/PhabricatorProjectEditor.php
··· 213 213 $xaction->setOldValue($project->getStatus()); 214 214 break; 215 215 case PhabricatorProjectTransactionType::TYPE_MEMBERS: 216 - $member_phids = $project->loadMemberPHIDs(); 217 - $project->attachMemberPHIDs($member_phids); 216 + $member_phids = $project->getMemberPHIDs(); 218 217 219 218 $old_value = array_values($member_phids); 220 219 $xaction->setOldValue($old_value);
-9
src/applications/project/storage/PhabricatorProject.php
··· 112 112 return $this->assertAttached($this->memberPHIDs); 113 113 } 114 114 115 - public function loadMemberPHIDs() { 116 - if (!$this->getPHID()) { 117 - return array(); 118 - } 119 - return PhabricatorEdgeQuery::loadDestinationPHIDs( 120 - $this->getPHID(), 121 - PhabricatorEdgeConfig::TYPE_PROJ_MEMBER); 122 - } 123 - 124 115 public function setPhrictionSlug($slug) { 125 116 126 117 // NOTE: We're doing a little magic here and stripping out '/' so that