Page MenuHomePhabricator

D7627.diff
No OneTemporary

D7627.diff

Index: src/applications/search/controller/PhabricatorApplicationSearchController.php
===================================================================
--- src/applications/search/controller/PhabricatorApplicationSearchController.php
+++ 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);
Index: src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
===================================================================
--- src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
+++ 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/plain
Expires
Thu, Nov 7, 9:11 AM (5 d, 16 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6719780
Default Alt Text
D7627.diff (1 KB)

Event Timeline