Avoid to instantiate custom form element validators directly
refs #8415
This commit is contained in:
parent
eb3063e36d
commit
6c70a53309
|
@ -5,7 +5,6 @@ namespace Icinga\Forms\Config\General;
|
|||
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Validator\WritablePathValidator;
|
||||
|
||||
class LoggingConfigForm extends Form
|
||||
{
|
||||
|
@ -107,7 +106,7 @@ class LoggingConfigForm extends Form
|
|||
'label' => $this->translate('File path'),
|
||||
'description' => $this->translate('The full path to the log file to write messages to.'),
|
||||
'value' => '/var/log/icingaweb2/icingaweb2.log',
|
||||
'validators' => array(new WritablePathValidator())
|
||||
'validators' => array('WritablePathValidator')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
namespace Icinga\Forms\Config\Resource;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Validator\ReadablePathValidator;
|
||||
|
||||
/**
|
||||
* Form class for adding/modifying file resources
|
||||
|
@ -40,7 +39,7 @@ class FileResourceForm extends Form
|
|||
'required' => true,
|
||||
'label' => $this->translate('Filepath'),
|
||||
'description' => $this->translate('The filename to fetch information from'),
|
||||
'validators' => array(new ReadablePathValidator())
|
||||
'validators' => array('ReadablePathValidator')
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
|
|
Loading…
Reference in New Issue