1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Fix a couple more "URI->alter()" callsites in paging code

Summary: `grep` had a hard time finding these.

Test Plan: Will just hotfix this since I'm still reasonably in the deploy window, this currently fatals: <https://secure.phabricator.com/search/query/_dgatshiRBSy/#R>

Reviewers: amckinley

Differential Revision: https://secure.phabricator.com/D20186
This commit is contained in:
epriestley 2019-02-16 07:26:19 -08:00
parent 3058cae4b8
commit dbcf41dbea

View file

@ -187,9 +187,15 @@ final class PHUIPagerView extends AphrontView {
foreach ($pager_index as $key => $index) {
if ($index !== null) {
$display_index = $this->getDisplayIndex($index);
$pager_links[$key] = (string)$base_uri->alter(
$parameter,
$display_index);
$uri = id(clone $base_uri);
if ($display_index === null) {
$uri->removeQueryParam($parameter);
} else {
$uri->replaceQueryParam($parameter, $display_index);
}
$pager_links[$key] = phutil_string_cast($uri);
}
}
Javelin::initBehavior('phabricator-keyboard-pager', $pager_links);
@ -200,10 +206,17 @@ final class PHUIPagerView extends AphrontView {
foreach ($links as $link) {
list($index, $label, $class) = $link;
$display_index = $this->getDisplayIndex($index);
$link = $base_uri->alter($parameter, $display_index);
$uri = id(clone $base_uri);
if ($display_index === null) {
$uri->removeQueryParam($parameter);
} else {
$uri->replaceQueryParam($parameter, $display_index);
}
$rendered_links[] = id(new PHUIButtonView())
->setTag('a')
->setHref($link)
->setHref($uri)
->setColor(PHUIButtonView::GREY)
->addClass('mml')
->addClass($class)