Page MenuHomePhabricator

D7627.diff

diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php
--- a/src/applications/search/controller/PhabricatorApplicationSearchController.php
+++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php
@@ -198,7 +198,16 @@
$pager = new AphrontCursorPagerView();
$pager->readFromRequest($request);
- $pager->setPageSize($engine->getPageSize($saved_query));
+ $page_size = $engine->getPageSize($saved_query);
+ if (is_finite($page_size)) {
+ $pager->setPageSize($page_size);
+ } else {
+ // Consider an INF pagesize to mean a large finite pagesize.
+
+ // TODO: It would be nice to handle this more gracefully, but math
+ // with INF seems to vary across PHP versions, systems, and runtimes.
+ $pager->setPageSize(0xFFFF);
+ }
$objects = $query->setViewer($request->getUser())
->executeWithCursorPager($pager);
diff --git a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
--- a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
+++ b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
@@ -19,6 +19,11 @@
}
protected function getPagingValue($result) {
+ if (!is_object($result)) {
+ // This interface can't be typehinted and PHP gets really angry if we
+ // call a method on a non-object, so add an explicit check here.
+ throw new Exception(pht('Expected object, got "%s"!', gettype($result)));
+ }
return $result->getID();
}

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/jp/vk/fym7i75rufxxxtvr
Default Alt Text
D7627.diff (1 KB)

Event Timeline