Skip to content

Commit

Permalink
ConfigForm: Only render valid configurations in the ui
Browse files Browse the repository at this point in the history
refs #3648

Signed-off-by: Eric Lippmann <eric.lippmann@icinga.com>
  • Loading branch information
nilmerg authored and lippserd committed Feb 5, 2019
1 parent ed7ecb3 commit 1e0a2cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions application/forms/ConfigForm.php
Expand Up @@ -4,6 +4,7 @@
namespace Icinga\Forms;

use Exception;
use Icinga\Exception\ConfigurationError;
use Zend_Form_Decorator_Abstract;
use Icinga\Application\Config;
use Icinga\Web\Form;
Expand Down Expand Up @@ -99,6 +100,10 @@ public function save()
{
try {
$this->writeConfig($this->config);
} catch (ConfigurationError $e) {
$this->addError($e->getMessage());

return false;
} catch (Exception $e) {
$this->addDecorator('ViewScript', array(
'viewModule' => 'default',
Expand Down

0 comments on commit 1e0a2cd

Please sign in to comment.