mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +01:00
Unfatal "Create Repository" UI
See: <https://github.com/facebook/phabricator/issues/584> Not all controllers in Diffusion have a DiffusionRequest. Auditors: btrahan
This commit is contained in:
parent
466af33147
commit
d5f874b493
1 changed files with 16 additions and 11 deletions
|
@ -41,20 +41,25 @@ abstract class DiffusionController extends PhabricatorController {
|
|||
}
|
||||
|
||||
public function buildApplicationPage($view, array $options) {
|
||||
$drequest = $this->getDiffusionRequest();
|
||||
$repository = $drequest->getRepository();
|
||||
$error_view = $this->buildRepositoryWarning($repository);
|
||||
if ($this->diffusionRequest) {
|
||||
$drequest = $this->getDiffusionRequest();
|
||||
$repository = $drequest->getRepository();
|
||||
$error_view = $this->buildRepositoryWarning($repository);
|
||||
|
||||
$views = array();
|
||||
$not_inserted = true;
|
||||
foreach ($view as $view_object_or_array) {
|
||||
$views[] = $view_object_or_array;
|
||||
if ($not_inserted &&
|
||||
$view_object_or_array instanceof PhabricatorCrumbsView) {
|
||||
$views[] = $error_view;
|
||||
$not_inserted = false;
|
||||
$views = array();
|
||||
$not_inserted = true;
|
||||
foreach ($view as $view_object_or_array) {
|
||||
$views[] = $view_object_or_array;
|
||||
if ($not_inserted &&
|
||||
$view_object_or_array instanceof PhabricatorCrumbsView) {
|
||||
$views[] = $error_view;
|
||||
$not_inserted = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$views = $view;
|
||||
}
|
||||
|
||||
return parent::buildApplicationPage($views, $options);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue