IcingaObject: do not load groups when we have...

...no id. With branches this is now possible
This commit is contained in:
Thomas Gelf 2021-10-05 18:10:50 +02:00
parent 1a5df745e3
commit 182d1b519b
1 changed files with 1 additions and 1 deletions

View File

@ -836,7 +836,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
{
$this->assertGroupsSupport();
if ($this->groups === null) {
if ($this->hasBeenLoadedFromDb()) {
if ($this->hasBeenLoadedFromDb() && $this->get('id')) {
$this->groups = IcingaObjectGroups::loadForStoredObject($this);
} else {
$this->groups = new IcingaObjectGroups($this);