From: Tim Otten Date: Sat, 4 Jul 2020 03:51:31 +0000 (-0700) Subject: SetupController - If you install and then reload the install screen, re-render the... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7fb6cf4c86cdc4e561ac2901dd2d859dc8ae3ac2;p=civicrm-core.git SetupController - If you install and then reload the install screen, re-render the finish message. --- diff --git a/setup/src/Setup/UI/SetupController.php b/setup/src/Setup/UI/SetupController.php index 0d1d1a0d4a..444bea24d3 100644 --- a/setup/src/Setup/UI/SetupController.php +++ b/setup/src/Setup/UI/SetupController.php @@ -81,7 +81,7 @@ class SetupController implements SetupControllerInterface { public function runStart($method, $fields) { $checkInstalled = $this->setup->checkInstalled(); if ($checkInstalled->isDatabaseInstalled() || $checkInstalled->isSettingInstalled()) { - return $this->createError("CiviCRM is already installed"); + return $this->renderAlreadyInstalled(); } /** @@ -120,7 +120,7 @@ class SetupController implements SetupControllerInterface { public function runInstall($method, $fields) { $checkInstalled = $this->setup->checkInstalled(); if ($checkInstalled->isDatabaseInstalled() || $checkInstalled->isSettingInstalled()) { - return $this->createError("CiviCRM is already installed"); + return $this->renderAlreadyInstalled(); } $reqs = $this->setup->checkRequirements(); @@ -130,16 +130,7 @@ class SetupController implements SetupControllerInterface { $this->setup->installFiles(); $this->setup->installDatabase(); - - $m = $this->setup->getModel(); - $tplFile = $this->getResourcePath('finished.' . $m->cms . '.php'); - if (file_exists($tplFile)) { - $tplVars = array(); - return array(array(), $this->render($tplFile, $tplVars)); - } - else { - return $this->createError("Installation succeeded. However, the final page ($tplFile) was not available."); - } + return $this->renderFinished(); } /** @@ -290,4 +281,24 @@ class SetupController implements SetupControllerInterface { return $this->setup; } + private function renderAlreadyInstalled() { + // return $this->createError("CiviCRM is already installed"); + return $this->renderFinished(); + } + + /** + * @return array + */ + private function renderFinished() { + $m = $this->setup->getModel(); + $tplFile = $this->getResourcePath('finished.' . $m->cms . '.php'); + if (file_exists($tplFile)) { + $tplVars = array(); + return array(array(), $this->render($tplFile, $tplVars)); + } + else { + return $this->createError("Installation succeeded. However, the final page ($tplFile) was not available."); + } + } + }