mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
IcingaObjectGroup: re-enable group membership...
...resolver refs #2048
This commit is contained in:
parent
8cbde4a50e
commit
d429c9e5cc
@ -22,6 +22,8 @@ abstract class IcingaObjectGroup extends IcingaObject implements ExportInterface
|
||||
'assign_filter' => null,
|
||||
];
|
||||
|
||||
protected $memberShipShouldBeRefreshed = false;
|
||||
|
||||
public function getUniqueIdentifier()
|
||||
{
|
||||
return $this->getObjectName();
|
||||
@ -32,24 +34,27 @@ abstract class IcingaObjectGroup extends IcingaObject implements ExportInterface
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function memberShipShouldBeRefreshed(): bool
|
||||
protected function beforeStore()
|
||||
{
|
||||
parent::beforeStore();
|
||||
if ($this->hasBeenLoadedFromDb()) {
|
||||
if (!array_key_exists('assign_filter', $this->getModifiedProperties())) {
|
||||
return false;
|
||||
$this->memberShipShouldBeRefreshed = false;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if ($this->get('assign_filter') === null) {
|
||||
return false;
|
||||
$this->memberShipShouldBeRefreshed = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
$this->memberShipShouldBeRefreshed = true;
|
||||
}
|
||||
|
||||
protected function notifyResolvers()
|
||||
{
|
||||
if ($this->memberShipShouldBeRefreshed()) {
|
||||
if ($this->memberShipShouldBeRefreshed) {
|
||||
$resolver = $this->getMemberShipResolver();
|
||||
$resolver->addGroup($this);
|
||||
$resolver->refreshDb();
|
||||
|
Loading…
x
Reference in New Issue
Block a user