Page MenuHomePhabricator
Paste P2115

panel_fix_pagination.patch
ActivePublic

Authored by jbrownEP on Apr 2 2019, 1:16 AM.
Tags
None
Referenced Files
F6330212: raw.txt
Apr 2 2019, 1:16 AM
Subscribers
None
diff --git a/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php b/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php
index a71263b27..95324ef26 100644
--- a/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php
+++ b/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php
@@ -136,30 +136,32 @@ final class PhabricatorDashboardQueryPanelType
$results_view->setContent($content);
}
- if ($pager->getHasMoreResults()) {
- $item_list = $results_view->getObjectList();
-
- $more_href = $engine->getQueryResultsPageURI($key);
- if ($item_list) {
- $item_list->newTailButton()
- ->setHref($more_href);
- } else {
- // For search engines that do not return an object list, add a fake
- // one to the end so we can render a "View All Results" button that
- // looks like it does in normal applications. At time of writing,
- // several major applications like Maniphest (which has group headers)
- // and Feed (which uses custom rendering) don't return simple lists.
-
- $content = $results_view->getContent();
-
- $more_list = id(new PHUIObjectItemListView())
- ->setAllowEmptyList(true);
-
- $more_list->newTailButton()
- ->setHref($more_href);
-
- $content = array($content, $more_list);
- $results_view->setContent($content);
+ if (!$engine->shouldUseOffsetPaging()) {
+ if ($pager->getHasMoreResults()) {
+ $item_list = $results_view->getObjectList();
+
+ $more_href = $engine->getQueryResultsPageURI($key);
+ if ($item_list) {
+ $item_list->newTailButton()
+ ->setHref($more_href);
+ } else {
+ // For search engines that do not return an object list, add a fake
+ // one to the end so we can render a "View All Results" button that
+ // looks like it does in normal applications. At time of writing,
+ // several major applications like Maniphest (which has group headers)
+ // and Feed (which uses custom rendering) don't return simple lists.
+
+ $content = $results_view->getContent();
+
+ $more_list = id(new PHUIObjectItemListView())
+ ->setAllowEmptyList(true);
+
+ $more_list->newTailButton()
+ ->setHref($more_href);
+
+ $content = array($content, $more_list);
+ $results_view->setContent($content);
+ }
}
}

Event Timeline

jbrownEP changed the title of this paste from untitled to Masterwork From Distant Lands.
jbrownEP changed the title of this paste from Masterwork From Distant Lands to panel_fix_pagination.patch.Apr 2 2019, 2:14 AM