Page MenuHomePhabricator

D20186.diff
No OneTemporary

D20186.diff

diff --git a/src/view/phui/PHUIPagerView.php b/src/view/phui/PHUIPagerView.php
--- a/src/view/phui/PHUIPagerView.php
+++ b/src/view/phui/PHUIPagerView.php
@@ -187,9 +187,15 @@
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 @@
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)

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 25, 2:08 PM (11 h, 16 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6926624
Default Alt Text
D20186.diff (1 KB)

Event Timeline