Skip to content

Commit

Permalink
IcingaObjectFieldLoader: no mandatory field on cmd
Browse files Browse the repository at this point in the history
fixes #12644
  • Loading branch information
Thomas-Gelf committed Jan 13, 2017
1 parent f845c2c commit f874a79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Director/Objects/DirectorDatafield.php
Expand Up @@ -81,7 +81,9 @@ public function getFormElement(DirectorObjectForm $form, $name = null)
$dataType->setSettings($this->getSettings());
$el = $dataType->getFormElement($name, $form);

if ($this->getSetting('is_required') === 'y') {
if ($this->getSetting('icinga_type') !== 'command'
&& $this->getSetting('is_required') === 'y'
) {
$el->setRequired(true);
}
if ($caption = $this->get('caption')) {
Expand Down
1 change: 1 addition & 0 deletions library/Director/Web/Form/IcingaObjectFieldLoader.php
Expand Up @@ -467,6 +467,7 @@ protected function prepareSelectForIds(array $ids)
array('df' => 'director_datafield'),
array(
'object_id' => $idColumn,
'icinga_type' => "('" . $object->getShortTableName() . "')",
'var_filter' => 'f.var_filter',
'is_required' => 'f.is_required',
'id' => 'df.id',
Expand Down

0 comments on commit f874a79

Please sign in to comment.