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

Don't set NULL values in array returned from loadObjects()

Summary: Delete some dead code in Feed along the way.

Test Plan:
/feed/
/search/

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

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

vrana 5623abec 9fc54f4d

+2 -25
-4
src/applications/conduit/method/feed/query/ConduitAPI_feed_query_Method.php
··· 89 89 90 90 if ($stories) { 91 91 $handle_phids = array_mergev(mpull($stories, 'getRequiredHandlePHIDs')); 92 - $object_phids = array_mergev(mpull($stories, 'getRequiredObjectPHIDs')); 93 92 $handles = id(new PhabricatorObjectHandleData($handle_phids)) 94 93 ->loadHandles(); 95 - $objects = id(new PhabricatorObjectHandleData($object_phids)) 96 - ->loadObjects(); 97 94 98 95 foreach ($stories as $story) { 99 96 100 97 $story->setHandles($handles); 101 - $story->setObjects($objects); 102 98 103 99 $story_data = $story->getStoryData(); 104 100
-4
src/applications/feed/builder/feed/PhabricatorFeedBuilder.php
··· 44 44 $stories = $this->stories; 45 45 46 46 $handles = array(); 47 - $objects = array(); 48 47 if ($stories) { 49 48 $handle_phids = array_mergev(mpull($stories, 'getRequiredHandlePHIDs')); 50 49 $object_phids = array_mergev(mpull($stories, 'getRequiredObjectPHIDs')); 51 50 $handles = id(new PhabricatorObjectHandleData($handle_phids)) 52 51 ->loadHandles(); 53 - $objects = id(new PhabricatorObjectHandleData($object_phids)) 54 - ->loadObjects(); 55 52 } 56 53 57 54 $null_view = new AphrontNullView(); ··· 61 58 $last_date = null; 62 59 foreach ($stories as $story) { 63 60 $story->setHandles($handles); 64 - $story->setObjects($objects); 65 61 $story->setFramed($this->framed); 66 62 67 63 $date = ucfirst(phabricator_relative_date($story->getEpoch(), $user));
-10
src/applications/feed/story/base/PhabricatorFeedStory.php
··· 21 21 private $data; 22 22 23 23 private $handles; 24 - private $objects; 25 24 private $framed; 26 25 27 26 final public function __construct(PhabricatorFeedStoryData $data) { ··· 48 47 return $this; 49 48 } 50 49 51 - final public function setObjects(array $objects) { 52 - $this->objects = $objects; 53 - return $this; 54 - } 55 - 56 50 final protected function getHandles() { 57 51 return $this->handles; 58 52 } ··· 69 63 $handle->setName("Unloaded Object '{$phid}'"); 70 64 71 65 return $handle; 72 - } 73 - 74 - final protected function getObjects() { 75 - return $this->objects; 76 66 } 77 67 78 68 final public function getStoryData() {
-2
src/applications/feed/story/differential/PhabricatorFeedStoryDifferential.php
··· 38 38 39 39 $author_phid = $data->getAuthorPHID(); 40 40 41 - $objects = $this->getObjects(); 42 - 43 41 $view = new PhabricatorFeedStoryView(); 44 42 45 43 $revision_phid = $data->getValue('revision_phid');
-1
src/applications/feed/story/maniphest/PhabricatorFeedStoryManiphest.php
··· 41 41 $owner_phid = $data->getValue('ownerPHID'); 42 42 $task_phid = $data->getValue('taskPHID'); 43 43 44 - $objects = $this->getObjects(); 45 44 $action = $data->getValue('action'); 46 45 47 46 $view = new PhabricatorFeedStoryView();
-2
src/applications/feed/story/phriction/PhabricatorFeedStoryPhriction.php
··· 37 37 $author_phid = $data->getAuthorPHID(); 38 38 $document_phid = $data->getValue('phid'); 39 39 40 - $objects = $this->getObjects(); 41 - 42 40 $view = new PhabricatorFeedStoryView(); 43 41 44 42 $action = $data->getValue('action');
+1 -1
src/applications/phid/handle/data/PhabricatorObjectHandleData.php
··· 36 36 $types[$type][] = $phid; 37 37 } 38 38 39 - $objects = array_fill_keys($this->phids, null); 39 + $objects = array(); 40 40 foreach ($types as $type => $phids) { 41 41 switch ($type) { 42 42 case PhabricatorPHIDConstants::PHID_TYPE_USER:
+1 -1
src/applications/search/controller/search/PhabricatorSearchController.php
··· 275 275 $view = new PhabricatorSearchResultView(); 276 276 $view->setHandle($handle); 277 277 $view->setQuery($query); 278 - $view->setObject($objects[$phid]); 278 + $view->setObject(idx($objects, $phid)); 279 279 $results[] = $view->render(); 280 280 } 281 281 $results =