ConfigForm: Only render valid configurations in the ui

refs #3648

Signed-off-by: Eric Lippmann <eric.lippmann@icinga.com>
This commit is contained in:
Johannes Meyer 2019-02-01 10:58:35 +01:00 committed by Eric Lippmann
parent ed7ecb32a5
commit 1e0a2cdb64
1 changed files with 5 additions and 0 deletions

View File

@ -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;
@ -99,6 +100,10 @@ class ConfigForm extends Form
{
try {
$this->writeConfig($this->config);
} catch (ConfigurationError $e) {
$this->addError($e->getMessage());
return false;
} catch (Exception $e) {
$this->addDecorator('ViewScript', array(
'viewModule' => 'default',