@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 rendering of offset-paged query panels including "Notifications"

Summary:
See <https://discourse.phabricator-community.org/t/call-to-undefined-method-phuipagerview-gethasmoreresults-in-2019-week-13/2586/>.

A small number of queries (including "Notifications" and (global) "Search") use offset-based pagers which have a slightly different API `PHUIPagerView` instead of `AphrontCursorPagerView`. This leads to a fatal in the new code for the "View All Results" buttons.

To fix this, just do an `instanceof` test. Some day we can unify the pagers.

Test Plan: Added a notifications panel, rendered it, saw it work instead of fataling on "getHasMoreResults()". Also rendered some normal panels.

Reviewers: amckinley

Reviewed By: amckinley

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

+10 -1
+10 -1
src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php
··· 136 136 $results_view->setContent($content); 137 137 } 138 138 139 - if ($pager->getHasMoreResults()) { 139 + // TODO: A small number of queries, including "Notifications" and "Search", 140 + // use an offset pager which has a slightly different API. Some day, we 141 + // should unify these. 142 + if ($pager instanceof PHUIPagerView) { 143 + $has_more = $pager->getHasMorePages(); 144 + } else { 145 + $has_more = $pager->getHasMoreResults(); 146 + } 147 + 148 + if ($has_more) { 140 149 $item_list = $results_view->getObjectList(); 141 150 142 151 $more_href = $engine->getQueryResultsPageURI($key);