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

Ported loadAuxiliaryFields method to differential.query conduit method

Summary: Ported the the loadAuxiliaryfields method from differential.getrevision method to modern conduit differential.query method

Test Plan: Created a test diff in differential to see if nothing has been broken

Reviewers: epriestley

CC: aran, Korvin

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

authored by

Afaque Hussain and committed by
epriestley
a521790f 1bb160a2

+23
+23
src/applications/differential/conduit/ConduitAPI_differential_query_Method.php
··· 196 196 } 197 197 198 198 $id = $revision->getID(); 199 + $auxiliary_fields = $this->loadAuxiliaryFields( 200 + $revision, $request->getUser()); 199 201 $result = array( 200 202 'id' => $id, 201 203 'phid' => $revision->getPHID(), ··· 217 219 'reviewers' => array_values($revision->getReviewers()), 218 220 'ccs' => array_values($revision->getCCPHIDs()), 219 221 'hashes' => $revision->getHashes(), 222 + 'auxiliary' => $auxiliary_fields, 220 223 ); 221 224 222 225 // TODO: This is a hacky way to put permissions on this field until we ··· 230 233 231 234 return $results; 232 235 } 236 + 237 + private function loadAuxiliaryFields( 238 + DifferentialRevision $revision, 239 + PhabricatorUser $user) { 240 + $aux_fields = DifferentialFieldSelector::newSelector() 241 + ->getFieldSpecifications(); 242 + foreach ($aux_fields as $key => $aux_field) { 243 + $aux_field->setUser($user); 244 + if (!$aux_field->shouldAppearOnConduitView()) { 245 + unset($aux_fields[$key]); 246 + } 247 + } 248 + 249 + $aux_fields = DifferentialAuxiliaryField::loadFromStorage( 250 + $revision, 251 + $aux_fields); 252 + 253 + return mpull($aux_fields, 'getValueForConduit', 'getKeyForConduit'); 254 + } 255 + 233 256 }