mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-19 18:28:39 +01:00
Clean up a couple more URI alter() calls
Summary: See <https://discourse.phabricator-community.org/t/create-new-phriction-document-fails-with-unhandled-exception-invalidargumentexception/2406>. These weren't obviously nullable from a cursory `grep`, but are sometimes nullable in practice. Test Plan: Created, then saved a new Phriction document. Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D20184
This commit is contained in:
parent
c5772f51de
commit
b09cf166a8
2 changed files with 23 additions and 5 deletions
|
@ -229,9 +229,14 @@ final class PhrictionTransactionEditor
|
||||||
foreach ($xactions as $xaction) {
|
foreach ($xactions as $xaction) {
|
||||||
switch ($xaction->getTransactionType()) {
|
switch ($xaction->getTransactionType()) {
|
||||||
case PhrictionDocumentContentTransaction::TRANSACTIONTYPE:
|
case PhrictionDocumentContentTransaction::TRANSACTIONTYPE:
|
||||||
$uri = id(new PhutilURI('/phriction/diff/'.$object->getID().'/'))
|
$params = array(
|
||||||
->alter('l', $this->getOldContent()->getVersion())
|
'l' => $this->getOldContent()->getVersion(),
|
||||||
->alter('r', $this->getNewContent()->getVersion());
|
'r' => $this->getNewContent()->getVersion(),
|
||||||
|
);
|
||||||
|
|
||||||
|
$path = '/phriction/diff/'.$object->getID().'/';
|
||||||
|
$uri = new PhutilURI($path, $params);
|
||||||
|
|
||||||
$this->contentDiffURI = (string)$uri;
|
$this->contentDiffURI = (string)$uri;
|
||||||
break 2;
|
break 2;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -154,8 +154,21 @@ final class PHUITimelineView extends AphrontView {
|
||||||
}
|
}
|
||||||
|
|
||||||
$uri = $this->getPager()->getNextPageURI();
|
$uri = $this->getPager()->getNextPageURI();
|
||||||
$uri->replaceQueryParam('quoteTargetID', $this->getQuoteTargetID());
|
|
||||||
$uri->replaceQueryParam('quoteRef', $this->getQuoteRef());
|
$target_id = $this->getQuoteTargetID();
|
||||||
|
if ($target_id === null) {
|
||||||
|
$uri->removeQueryParam('quoteTargetID');
|
||||||
|
} else {
|
||||||
|
$uri->replaceQueryParam('quoteTargetID', $target_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
$quote_ref = $this->getQuoteRef();
|
||||||
|
if ($quote_ref === null) {
|
||||||
|
$uri->removeQueryParam('quoteRef');
|
||||||
|
} else {
|
||||||
|
$uri->replaceQueryParam('quoteRef', $quote_ref);
|
||||||
|
}
|
||||||
|
|
||||||
$events[] = javelin_tag(
|
$events[] = javelin_tag(
|
||||||
'div',
|
'div',
|
||||||
array(
|
array(
|
||||||
|
|
Loading…
Add table
Reference in a new issue