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

Fix offset-without-limit case in Policy query

Summary: Apparently I am not qualified to do basic math.

Test Plan: Unit test.

Reviewers: vrana

Reviewed By: vrana

CC: aran

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

+10 -2
+5 -1
src/applications/policy/__tests__/PhabricatorPolicyTestCase.php
··· 133 133 2, 134 134 count($query->setLimit(3)->setOffset(1)->execute()), 135 135 'Offsets work correctly.'); 136 + 137 + $this->assertEqual( 138 + 2, 139 + count($query->setLimit(0)->setOffset(1)->execute()), 140 + 'Offset with no limit works.'); 136 141 } 137 142 138 143 ··· 163 168 count($query->setLimit(3)->setOffset(4)->execute()), 164 169 'Limit + offset work.'); 165 170 } 166 - 167 171 168 172 169 173 /**
+5 -1
src/infrastructure/query/policy/PhabricatorPolicyQuery.php
··· 153 153 $limit = (int)$this->getLimit(); 154 154 $count = 0; 155 155 156 - $need = $offset + $limit; 156 + if ($limit) { 157 + $need = $offset + $limit; 158 + } else { 159 + $need = 0; 160 + } 157 161 158 162 $this->willExecute(); 159 163