1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-26 07:20:57 +01:00

Fix some "URI->alter(X, null)" callsites

Summary:
Ref T13250. This internally calls `replaceQueryParam(X, null)` now, which fatals if the second parameter is `null`. I hit these legitimately, but I'll look for more callsites and follow up by either allowing this, removing `alter()`, fixing the callsites, or some combination.

(I'm not much of a fan of `alter()`.)

Test Plan: Browsing a paginated list no longer complains about URI construction.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13250

Differential Revision: https://secure.phabricator.com/D20162
This commit is contained in:
epriestley 2019-02-13 09:13:38 -08:00
parent 5892c78986
commit be21dd3b52

View file

@ -99,9 +99,9 @@ final class AphrontCursorPagerView extends AphrontView {
return null;
}
return $this->uri
->alter('before', null)
->alter('after', null);
return id(clone $this->uri)
->removeQueryParam('after')
->removeQueryParam('before');
}
public function getPrevPageURI() {
@ -113,9 +113,9 @@ final class AphrontCursorPagerView extends AphrontView {
return null;
}
return $this->uri
->alter('after', null)
->alter('before', $this->prevPageID);
return id(clone $this->uri)
->removeQueryParam('after')
->replaceQueryParam('before', $this->prevPageID);
}
public function getNextPageURI() {
@ -127,9 +127,9 @@ final class AphrontCursorPagerView extends AphrontView {
return null;
}
return $this->uri
->alter('after', $this->nextPageID)
->alter('before', null);
return id(clone $this->uri)
->replaceQueryParam('after', $this->nextPageID)
->removeQueryParam('before');
}
public function render() {