Skip to content

Commit

Permalink
Fix editing of multi-selected services with same name
Browse files Browse the repository at this point in the history
Since the object names function as keys for the multi-selected objects array, this becomes a problem when
multiple services as the same name. Hence for the services the array keys must be a combination of service name
and the host name to which the service is related.
  • Loading branch information
raviks789 committed Sep 12, 2023
1 parent 079bf87 commit 83cc96d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/Director/Web/Controller/ObjectsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,12 @@ protected function loadMultiObjectsFromParams()
$objects[$name] = $class::load($name, $db);
} elseif ($col === 'uuid') {
$object = $store->load($table, Uuid::fromString($ex->getExpression()));
$objects[$object->getObjectName()] = $object;
if ($type === 'service') {
$host = IcingaHost::loadWithAutoIncId($object->get('host_id'), $db);
$objects[$host->getObjectName() . ':' . $object->getObjectName()] = $object;
} else {
$objects[$object->getObjectName()] = $object;
}
} else {
throw new InvalidArgumentException("'$col' is no a valid key component for '$type'");
}
Expand Down

0 comments on commit 83cc96d

Please sign in to comment.