Skip to content

Commit

Permalink
IcingaObjectMultiRelations: Set property modified to false when loa…
Browse files Browse the repository at this point in the history
…ded from DB
  • Loading branch information
raviks789 committed Aug 13, 2024
1 parent 428a49f commit 302122e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"apply_to": "service",
"assign_filter": "host.name=%22h1%22",
"imports": [
"nt1"
],
"notification_interval": 0,
"object_name": "service_warn",
"object_type": "apply",
"states": [
"Warning"
],
"types": [
"Problem"
],
"users": [
"u2"
]
}
1 change: 1 addition & 0 deletions library/Director/Objects/IcingaObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public function getMultiRelation($property)
public function setMultiRelation($property, $values)
{
$this->getMultiRelation($property)->set($values);

return $this;
}

Expand Down
2 changes: 2 additions & 0 deletions library/Director/Objects/IcingaObjectMultiRelations.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ public function setBeingLoadedFromDb()
foreach ($this->relations as $k => $v) {
$this->stored[$k] = clone($v);
}

$this->modified = false;
}

protected function getRelatedClassName()
Expand Down

0 comments on commit 302122e

Please sign in to comment.