mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
cowboy commit -- fixing fatal I introduced from D4174
Summary: we don't always have a diff so instead set an explicit title in the controller. Test Plan: no more fatals. grepped carefully for every call site and tested them all
This commit is contained in:
parent
2f82210e46
commit
86a106d0b1
5 changed files with 24 additions and 3 deletions
|
@ -132,6 +132,8 @@ final class DifferentialDiffViewController extends DifferentialController {
|
|||
->setVisibleChangesets($changesets)
|
||||
->setRenderingReferences($refs)
|
||||
->setStandaloneURI('/differential/changeset/')
|
||||
->setDiff($diff)
|
||||
->setTitle('D'.$diff->getID());
|
||||
->setUser($request->getUser());
|
||||
|
||||
return $this->buildStandardPageResponse(
|
||||
|
|
|
@ -304,6 +304,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
|||
$changeset_view->setRepository($repository);
|
||||
}
|
||||
$changeset_view->setSymbolIndexes($symbol_indexes);
|
||||
$changeset_view->setTitle('D'.$target->getID());
|
||||
|
||||
$diff_history = new DifferentialRevisionUpdateHistoryView();
|
||||
$diff_history->setDiffs($diffs);
|
||||
|
|
|
@ -20,6 +20,16 @@ final class DifferentialChangesetListView extends AphrontView {
|
|||
private $diff;
|
||||
private $vsMap = array();
|
||||
|
||||
private $title;
|
||||
|
||||
public function setTitle($title) {
|
||||
$this->title = $title;
|
||||
return $this;
|
||||
}
|
||||
private function getTitle() {
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function setBranch($branch) {
|
||||
$this->branch = $branch;
|
||||
return $this;
|
||||
|
@ -190,7 +200,7 @@ final class DifferentialChangesetListView extends AphrontView {
|
|||
|
||||
return
|
||||
id(new PhabricatorHeaderView())
|
||||
->setHeader('D'.$this->diff->getID())
|
||||
->setHeader($this->getTitle())
|
||||
->render().
|
||||
phutil_render_tag(
|
||||
'div',
|
||||
|
|
|
@ -14,13 +14,16 @@ final class DiffusionChangeController extends DiffusionController {
|
|||
// TODO: Refine this.
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$callsign = $drequest->getRepository()->getCallsign();
|
||||
|
||||
$repository = $drequest->getRepository();
|
||||
$callsign = $repository->getCallsign();
|
||||
$commit = $drequest->getRawCommit();
|
||||
$changesets = array(
|
||||
0 => $changeset,
|
||||
);
|
||||
|
||||
$changeset_view = new DifferentialChangesetListView();
|
||||
$changeset_view->setTitle(DiffusionView::nameCommit($repository, $commit));
|
||||
$changeset_view->setChangesets($changesets);
|
||||
$changeset_view->setVisibleChangesets($changesets);
|
||||
$changeset_view->setRenderingReferences(
|
||||
|
|
|
@ -257,7 +257,12 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
}
|
||||
}
|
||||
|
||||
$change_list_title = DiffusionView::nameCommit(
|
||||
$repository,
|
||||
$commit->getCommitIdentifier()
|
||||
);
|
||||
$change_list = new DifferentialChangesetListView();
|
||||
$change_list->setTitle($change_list_title);
|
||||
$change_list->setChangesets($changesets);
|
||||
$change_list->setVisibleChangesets($visible_changesets);
|
||||
$change_list->setRenderingReferences($references);
|
||||
|
|
Loading…
Reference in a new issue