ConfigForm: Only render valid configurations in the ui
refs #3648 Signed-off-by: Eric Lippmann <eric.lippmann@icinga.com>
This commit is contained in:
parent
ed7ecb32a5
commit
1e0a2cdb64
|
@ -4,6 +4,7 @@
|
||||||
namespace Icinga\Forms;
|
namespace Icinga\Forms;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Icinga\Exception\ConfigurationError;
|
||||||
use Zend_Form_Decorator_Abstract;
|
use Zend_Form_Decorator_Abstract;
|
||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
use Icinga\Web\Form;
|
use Icinga\Web\Form;
|
||||||
|
@ -99,6 +100,10 @@ class ConfigForm extends Form
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->writeConfig($this->config);
|
$this->writeConfig($this->config);
|
||||||
|
} catch (ConfigurationError $e) {
|
||||||
|
$this->addError($e->getMessage());
|
||||||
|
|
||||||
|
return false;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->addDecorator('ViewScript', array(
|
$this->addDecorator('ViewScript', array(
|
||||||
'viewModule' => 'default',
|
'viewModule' => 'default',
|
||||||
|
|
Loading…
Reference in New Issue