1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 10:12:41 +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 null;
} }
return $this->uri return id(clone $this->uri)
->alter('before', null) ->removeQueryParam('after')
->alter('after', null); ->removeQueryParam('before');
} }
public function getPrevPageURI() { public function getPrevPageURI() {
@ -113,9 +113,9 @@ final class AphrontCursorPagerView extends AphrontView {
return null; return null;
} }
return $this->uri return id(clone $this->uri)
->alter('after', null) ->removeQueryParam('after')
->alter('before', $this->prevPageID); ->replaceQueryParam('before', $this->prevPageID);
} }
public function getNextPageURI() { public function getNextPageURI() {
@ -127,9 +127,9 @@ final class AphrontCursorPagerView extends AphrontView {
return null; return null;
} }
return $this->uri return id(clone $this->uri)
->alter('after', $this->nextPageID) ->replaceQueryParam('after', $this->nextPageID)
->alter('before', null); ->removeQueryParam('before');
} }
public function render() { public function render() {