From d5f874b4933172451ca5cd1e23036200d6c0cee3 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 30 Apr 2014 03:47:54 -0700 Subject: [PATCH] Unfatal "Create Repository" UI See: Not all controllers in Diffusion have a DiffusionRequest. Auditors: btrahan --- .../controller/DiffusionController.php | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php index ef0225393a..3752a9f9cb 100644 --- a/src/applications/diffusion/controller/DiffusionController.php +++ b/src/applications/diffusion/controller/DiffusionController.php @@ -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); }