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

Modernize Feed and Phlux ordering/paging

Summary: Ref T7803. Move these off getReversePaging() / getPagingColumn().

Test Plan: Paged through Phlux and Feed.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7803

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

+52 -13
+20 -4
src/applications/feed/query/PhabricatorFeedQuery.php
··· 90 90 } 91 91 } 92 92 93 - protected function getPagingColumn() { 94 - return ($this->filterPHIDs 95 - ? 'ref.chronologicalKey' 96 - : 'story.chronologicalKey'); 93 + protected function getDefaultOrderVector() { 94 + return array('key'); 95 + } 96 + 97 + public function getOrderableColumns() { 98 + $table = ($this->filterPHIDs ? 'ref' : 'story'); 99 + return array( 100 + 'key' => array( 101 + 'table' => $table, 102 + 'column' => 'chronologicalKey', 103 + 'type' => 'int', 104 + 'unique' => true, 105 + ), 106 + ); 107 + } 108 + 109 + protected function getPagingValueMap($cursor, array $keys) { 110 + return array( 111 + 'key' => $cursor, 112 + ); 97 113 } 98 114 99 115 protected function getPagingValue($item) {
+32 -9
src/applications/phlux/query/PhluxVariableQuery.php
··· 3 3 final class PhluxVariableQuery 4 4 extends PhabricatorCursorPagedPolicyAwareQuery { 5 5 6 + private $ids; 6 7 private $keys; 7 8 private $phids; 9 + 10 + public function withIDs(array $ids) { 11 + $this->ids = $ids; 12 + return $this; 13 + } 8 14 9 15 public function withPHIDs(array $phids) { 10 16 $this->phids = $phids; ··· 34 40 private function buildWhereClause(AphrontDatabaseConnection $conn_r) { 35 41 $where = array(); 36 42 37 - $where[] = $this->buildPagingClause($conn_r); 43 + if ($this->ids !== null) { 44 + $where[] = qsprintf( 45 + $conn_r, 46 + 'id IN (%Ld)', 47 + $this->ids); 48 + } 38 49 39 - if ($this->keys) { 50 + if ($this->keys !== null) { 40 51 $where[] = qsprintf( 41 52 $conn_r, 42 53 'variableKey IN (%Ls)', 43 54 $this->keys); 44 55 } 45 56 46 - if ($this->phids) { 57 + if ($this->phids !== null) { 47 58 $where[] = qsprintf( 48 59 $conn_r, 49 60 'phid IN (%Ls)', 50 61 $this->phids); 51 62 } 63 + 64 + $where[] = $this->buildPagingClause($conn_r); 52 65 53 66 return $this->formatWhereClause($where); 54 67 } 55 68 56 - protected function getPagingColumn() { 57 - return 'variableKey'; 69 + protected function getDefaultOrderVector() { 70 + return array('key'); 58 71 } 59 72 60 - protected function getPagingValue($result) { 61 - return $result->getVariableKey(); 73 + public function getOrderableColumns() { 74 + return array( 75 + 'key' => array( 76 + 'column' => 'variableKey', 77 + 'type' => 'string', 78 + 'reverse' => true, 79 + 'unique' => true, 80 + ), 81 + ); 62 82 } 63 83 64 - protected function getReversePaging() { 65 - return true; 84 + protected function getPagingValueMap($cursor, array $keys) { 85 + $object = $this->loadCursorObject($cursor); 86 + return array( 87 + 'key' => $object->getVariableKey(), 88 + ); 66 89 } 67 90 68 91 public function getQueryApplicationClass() {