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

Improve rendering behavior for "foist upon" with an empty tokenizer

Summary:
Ref T13628. If you "Foist Upon", then delete the value in the tokenizer, then scroll down to the preview, you currently get an ugly "Unknown Object (???)" rendering.

This is technically correct in some vague sense and the transaction won't apply, but provide a more aesthetic rendering instead.

Test Plan: {F8487050}

Maniphest Tasks: T13628

Differential Revision: https://secure.phabricator.com/D21592
This commit is contained in:
epriestley 2021-03-03 15:59:35 -08:00
parent dec1413684
commit f3caf7e9fc

View file

@ -95,10 +95,20 @@ final class DifferentialRevisionAuthorTransaction
}
if ($is_foist) {
return pht(
'%s foisted this revision upon %s.',
$this->renderAuthor(),
$this->renderNewHandle());
if ($new_phid) {
return pht(
'%s foisted this revision upon %s.',
$this->renderAuthor(),
$this->renderNewHandle());
} else {
// This isn't a valid transaction that can be applied, but happens in
// the preview if you temporarily delete the tokenizer value.
return pht(
'%s foisted this revision upon...',
$this->renderAuthor());
}
}
return pht(