Skip to content

Commit

Permalink
Configuration: to not head on to migrations...
Browse files Browse the repository at this point in the history
...as long as the "Choose DB form" has errors. This avoids duplicate error
messages

refs #62
  • Loading branch information
Thomas-Gelf committed Dec 7, 2018
1 parent b9d3438 commit a6a3f35
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion application/controllers/ConfigurationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ public function indexAction()

return;
}
$form = ChooseDbResourceForm::load()->handleRequest();
$this->content()->add(Html::tag('div', [
'class' => 'icinga-module module-director'
], ChooseDbResourceForm::load()->handleRequest()));
], $form));
if ($form->hasErrors()) {
$this->addSingleTab($this->translate('Configuration'));

return;
}

if ($this->Config()->get('db', 'resource')) {
$db = $this->db();
Expand All @@ -42,6 +48,8 @@ public function indexAction()
try {
$this->showMigrations($db);
} catch (Exception $e) {
$this->addSingleTab($this->translate('Configuration'));

$this->content()->add(Html::tag('p', [
'class' => 'error',
], $e->getMessage()));
Expand Down

0 comments on commit a6a3f35

Please sign in to comment.