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

Move audit rendering into SearchEngine

Summary:
Ref T4986. Updates audit.

Slightly tweaks on method visibility.

Just used a HandleQuery since we have to rebuild the whole view thing otherwise; this is an unusual case.

Test Plan:
- Checked Audit.
- Checked Feed.
- Checked Slowvote.

{F151555}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4986

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

+36 -25
+1 -21
src/applications/audit/controller/PhabricatorAuditListController.php
··· 1 1 <?php 2 2 3 3 final class PhabricatorAuditListController 4 - extends PhabricatorAuditController 5 - implements PhabricatorApplicationSearchResultsControllerInterface { 4 + extends PhabricatorAuditController { 6 5 7 6 private $queryKey; 8 7 private $name; ··· 26 25 return $this->delegateToController($controller); 27 26 } 28 27 29 - public function renderResultsList( 30 - array $commits, 31 - PhabricatorSavedQuery $query) { 32 - assert_instances_of($commits, 'PhabricatorRepositoryCommit'); 33 - 34 - $viewer = $this->getRequest()->getUser(); 35 - $nodata = pht('No matching audits.'); 36 - $view = id(new PhabricatorAuditListView()) 37 - ->setUser($viewer) 38 - ->setCommits($commits) 39 - ->setAuthorityPHIDs( 40 - PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($viewer)) 41 - ->setNoDataString($nodata); 42 - 43 - $phids = $view->getRequiredHandlePHIDs(); 44 - $handles = $this->loadViewerHandles($phids); 45 - $view->setHandles($handles); 46 - return $view->buildList(); 47 - } 48 28 }
+31
src/applications/audit/query/PhabricatorCommitSearchEngine.php
··· 159 159 ); 160 160 } 161 161 162 + protected function renderResultList( 163 + array $commits, 164 + PhabricatorSavedQuery $query, 165 + array $handles) { 166 + 167 + assert_instances_of($commits, 'PhabricatorRepositoryCommit'); 168 + 169 + $viewer = $this->requireViewer(); 170 + $nodata = pht('No matching audits.'); 171 + $view = id(new PhabricatorAuditListView()) 172 + ->setUser($viewer) 173 + ->setCommits($commits) 174 + ->setAuthorityPHIDs( 175 + PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($viewer)) 176 + ->setNoDataString($nodata); 177 + 178 + $phids = $view->getRequiredHandlePHIDs(); 179 + if ($phids) { 180 + $handles = id(new PhabricatorHandleQuery()) 181 + ->setViewer($viewer) 182 + ->withPHIDs($phids) 183 + ->execute(); 184 + } else { 185 + $handles = array(); 186 + } 187 + 188 + $view->setHandles($handles); 189 + 190 + return $view->buildList(); 191 + } 192 + 162 193 }
+1 -1
src/applications/feed/query/PhabricatorFeedSearchEngine.php
··· 124 124 return parent::buildSavedQueryFromBuiltin($query_key); 125 125 } 126 126 127 - public function renderResultList( 127 + protected function renderResultList( 128 128 array $objects, 129 129 PhabricatorSavedQuery $query, 130 130 array $handles) {
+2 -2
src/applications/search/engine/PhabricatorApplicationSearchEngine.php
··· 576 576 return $this->renderResultList($objects, $query, $handles); 577 577 } 578 578 579 - public function getRequiredHandlePHIDsForResultList( 579 + protected function getRequiredHandlePHIDsForResultList( 580 580 array $objects, 581 581 PhabricatorSavedQuery $query) { 582 582 return array(); 583 583 } 584 584 585 - public function renderResultList( 585 + protected function renderResultList( 586 586 array $objects, 587 587 PhabricatorSavedQuery $query, 588 588 array $handles) {
+1 -1
src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
··· 121 121 return mpull($polls, 'getAuthorPHID'); 122 122 } 123 123 124 - public function renderResultList( 124 + protected function renderResultList( 125 125 array $polls, 126 126 PhabricatorSavedQuery $query, 127 127 array $handles) {