diff --git a/application/forms/KickstartForm.php b/application/forms/KickstartForm.php index a14601f1..a46d24cb 100644 --- a/application/forms/KickstartForm.php +++ b/application/forms/KickstartForm.php @@ -315,33 +315,30 @@ class KickstartForm extends QuickForm public function onSuccess() { - try { - if ($this->getSubmitLabel() === $this->storeConfigLabel) { - if ($this->storeResourceConfig()) { - parent::onSuccess(); - } else { - return; - } - } - - if ($this->getSubmitLabel() === $this->createDbLabel - || $this->getSubmitLabel() === $this->migrateDbLabel) { - $this->migrations()->applyPendingMigrations(); + if ($this->getSubmitLabel() === $this->storeConfigLabel) { + if ($this->storeResourceConfig()) { parent::onSuccess(); + } else { + return; } - - $values = $this->getValues(); - if ($this->endpoint && empty($values['password'])) { - $values['password'] = $this->endpoint->getApiUser()->password; - } - - $kickstart = new KickstartHelper($this->getDb()); - unset($values['resource']); - $kickstart->setConfig($values)->run(); - parent::onSuccess(); - } catch (Exception $e) { - $this->addException($e); } + + if ($this->getSubmitLabel() === $this->createDbLabel + || $this->getSubmitLabel() === $this->migrateDbLabel) { + $this->migrations()->applyPendingMigrations(); + parent::onSuccess(); + } + + $values = $this->getValues(); + if ($this->endpoint && empty($values['password'])) { + $values['password'] = $this->endpoint->getApiUser()->password; + } + + $kickstart = new KickstartHelper($this->getDb()); + unset($values['resource']); + $kickstart->setConfig($values)->run(); + + parent::onSuccess(); } protected function getResourceName()