mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
parent
9de28e7c79
commit
cda5f56038
@ -16,6 +16,7 @@ next (will be 1.8.1)
|
||||
* FIX: don't fail when showing a Host overriding multiple inherited groups (#2253)
|
||||
* FIX: deal with inherited values which are invalid for a select box (#2288)
|
||||
* FIX: Service Set preview inline Service Template links (#2334)
|
||||
* FIX: show Services applied with Rules involving applied Hostgroups (#2313)
|
||||
|
||||
### Icinga Configuration
|
||||
* FIX: rare race condition, where generated config might miss some files (#2351)
|
||||
|
@ -213,10 +213,26 @@ abstract class ObjectApplyMatches
|
||||
protected function __construct(IcingaObject $object)
|
||||
{
|
||||
$this->object = $object;
|
||||
$this->flatObject = $object->toPlainObject(true, false);
|
||||
$flat = $object->toPlainObject(true, false);
|
||||
// Sure, we are flat - but we might still want to match templates.
|
||||
unset($this->flatObject->imports);
|
||||
$this->flatObject->templates = $object->listFlatResolvedImportNames();
|
||||
static::flattenVars($this->flatObject);
|
||||
unset($flat->imports);
|
||||
$flat->templates = $object->listFlatResolvedImportNames();
|
||||
$this->addAppliedGroupsToFlatObject($flat, $object);
|
||||
static::flattenVars($flat);
|
||||
$this->flatObject = $flat;
|
||||
}
|
||||
|
||||
protected function addAppliedGroupsToFlatObject($flat, IcingaObject $object)
|
||||
{
|
||||
if ($object instanceof IcingaHost) {
|
||||
$appliedGroups = $object->getAppliedGroups();
|
||||
if (! empty($appliedGroups)) {
|
||||
if (isset($flat->groups)) {
|
||||
$flat->groups = array_merge($flat->groups, $appliedGroups);
|
||||
} else {
|
||||
$flat->groups = $appliedGroups;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user