mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
Fix paging for 'before ID' queries
Test Plan: https://secure.phabricator.com/paste/filter/all/?before=157 - 158 is missing. Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2330
This commit is contained in:
parent
2bdde748d9
commit
11ffed7cfc
1 changed files with 2 additions and 1 deletions
|
@ -87,7 +87,8 @@ final class AphrontIDPagerView extends AphrontView {
|
|||
|
||||
final public function sliceResults(array $results) {
|
||||
if (count($results) > $this->getPageSize()) {
|
||||
$results = array_slice($results, 0, $this->getPageSize(), true);
|
||||
$offset = ($this->beforeID ? count($results) - $this->getPageSize() : 0);
|
||||
$results = array_slice($results, $offset, $this->getPageSize(), true);
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue