Config code scares me... this fixes an error on Configuration / Logging

This commit is contained in:
Thomas Gelf 2014-03-08 13:13:49 +01:00
parent e8118f9116
commit 5c27f8153a
1 changed files with 13 additions and 12 deletions

View File

@ -29,13 +29,13 @@
namespace Icinga\Form\Config;
use \Zend_Config;
use \Zend_Form_Element_Text;
use \Icinga\Application\Config as IcingaConfig;
use \Icinga\Application\Icinga;
use \Icinga\Web\Form;
use \Icinga\Web\Form\Validator\WritablePathValidator;
use \Icinga\Web\Form\Decorator\ConditionalHidden;
use Zend_Config;
use Zend_Form_Element_Text;
use Icinga\Application\Config;
use Icinga\Application\Icinga;
use Icinga\Web\Form;
use Icinga\Web\Form\Validator\WritablePathValidator;
use Icinga\Web\Form\Decorator\ConditionalHidden;
/**
* Form class for setting the application wide logging configuration
@ -108,12 +108,13 @@ class LoggingForm extends Form
$config = $this->getConfiguration();
$logging = $config->logging;
if ($logging === null) {
$logging = new IcingaConfig(array());
$logging = new Zend_Config(array());
}
$debug = $config->logging->debug;
$debug = $logging->debug;
if ($debug === null) {
$debug = new IcingaConfig(array());
$debug = new Zend_Config(array());
}
$txtLogPath = new Zend_Form_Element_Text(
@ -191,10 +192,10 @@ class LoggingForm extends Form
{
$config = $this->getConfiguration();
if ($config->logging === null) {
$config->logging = new IcingaConfig(array());
$config->logging = new Zend_Config(array());
}
if ($config->logging->debug === null) {
$config->logging->debug = new IcingaConfig(array());
$config->logging->debug = new Zend_Config(array());
}
$values = $this->getValues();