@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
at upstream/main 35 lines 878 B view raw
1<?php 2 3abstract class PhabricatorSearchBaseController extends PhabricatorController { 4 5 protected function loadRelationshipObject() { 6 $request = $this->getRequest(); 7 $viewer = $this->getViewer(); 8 9 $phid = $request->getURIData('sourcePHID'); 10 11 return id(new PhabricatorObjectQuery()) 12 ->setViewer($viewer) 13 ->withPHIDs(array($phid)) 14 ->requireCapabilities( 15 array( 16 PhabricatorPolicyCapability::CAN_VIEW, 17 PhabricatorPolicyCapability::CAN_EDIT, 18 )) 19 ->executeOne(); 20 } 21 22 protected function loadRelationship($object) { 23 $request = $this->getRequest(); 24 $viewer = $this->getViewer(); 25 26 $relationship_key = $request->getURIData('relationshipKey'); 27 28 $list = PhabricatorObjectRelationshipList::newForObject( 29 $viewer, 30 $object); 31 32 return $list->getRelationship($relationship_key); 33 } 34 35}