Skip to content

Commit

Permalink
IcingaDependencyForm: Make parent host and parent service element val…
Browse files Browse the repository at this point in the history
…ues removeable
  • Loading branch information
raviks789 committed Feb 7, 2024
1 parent 5f31180 commit efe438c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions application/forms/IcingaDependencyForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,18 +344,22 @@ public function createApplyRuleFor(IcingaDependency $dependency)
protected function handleProperties(DbObject $object, &$values)
{
if ($this->hasBeenSent()) {
if (isset($values['parent_host'])
&& $this->isCustomVar($values['parent_host'])
) {
$values['parent_host_var'] = \trim($values['parent_host'], '$');
$values['parent_host'] = '';
if (isset($values['parent_host'])) {
if ($this->isCustomVar($values['parent_host'])) {
$values['parent_host_var'] = \trim($values['parent_host'], '$');
$values['parent_host'] = '';
} else {
$values['parent_host_var'] = '';
}
}

if (isset($values['parent_service'])
&& $this->isCustomVar($values['parent_service'])
) {
$values['parent_service_by_name'] = trim($values['parent_service'], '$');
$values['parent_service'] = '';
if (isset($values['parent_service'])) {
if ($this->isCustomVar($values['parent_service'])) {
$values['parent_service_by_name'] = trim($values['parent_service'], '$');
$values['parent_service'] = '';
} else {
$values['parent_service_by_name'] = '';
}
}
}

Expand Down

0 comments on commit efe438c

Please sign in to comment.