1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +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:
epriestley 2014-04-30 03:47:54 -07:00
parent 466af33147
commit d5f874b493

View file

@ -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);
}