diff --git a/library/Businessprocess/BpNode.php b/library/Businessprocess/BpNode.php index 90054d4..32eb7e5 100644 --- a/library/Businessprocess/BpNode.php +++ b/library/Businessprocess/BpNode.php @@ -112,7 +112,7 @@ class BpNode extends Node ); } $this->children[$name] = $node; - $this->children[] = $name; + $this->childNames[] = $name; $node->addParent($this); return $this; } diff --git a/library/Businessprocess/BusinessProcess.php b/library/Businessprocess/BusinessProcess.php index 001451c..995ba96 100644 --- a/library/Businessprocess/BusinessProcess.php +++ b/library/Businessprocess/BusinessProcess.php @@ -331,7 +331,6 @@ class BusinessProcess // Separate "parse-logic" from "retrieve-state-logic" // Allow DB-based backend // Use IcingaWeb2 Multi-Backend-Support - $check_results = array(); $hostFilter = array_keys($this->hosts); if ($this->state_type === self::HARD_STATE) { @@ -509,8 +508,9 @@ class BusinessProcess if ($pos !== false) { $host = substr($name, 0, $pos); $service = substr($name, $pos + 1); - if ($service === 'Hoststatus') { - return $this->create($host); + // TODO: deactivated, this scares me, test it + if (false && $service === 'Hoststatus') { + return $this->createHost($host); } else { return $this->createService($host, $service); } diff --git a/library/Businessprocess/Node.php b/library/Businessprocess/Node.php index 7e2e2b5..4c99d35 100644 --- a/library/Businessprocess/Node.php +++ b/library/Businessprocess/Node.php @@ -193,6 +193,7 @@ abstract class Node ) ); } + return $this->state; } @@ -297,7 +298,7 @@ abstract class Node return static::$stateToSortStateMap[$state]; } - throw new ProgrammingError('Got invalid state %s', $sort_state); + throw new ProgrammingError('Got invalid state: %s', var_export($state, 1)); } protected function sortStateTostate($sortState)