mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-04 04:39:34 -05:00
Fix deletion of all occurences of a node
In case the node is not a BP node, we simply have to remove all occurences of the node.
This commit is contained in:
parent
731541e667
commit
ce812c01bf
1 changed files with 13 additions and 9 deletions
|
|
@ -65,15 +65,19 @@ class NodeRemoveAction extends NodeAction
|
|||
$name = $this->getNodeName();
|
||||
$parentName = $this->getParentName();
|
||||
if ($parentName === null) {
|
||||
$oldDisplay = $config->getBpNode($name)->getDisplay();
|
||||
$config->removeNode($name);
|
||||
if ($config->getMetadata()->isManuallyOrdered()) {
|
||||
foreach ($config->getRootNodes() as $_ => $node) {
|
||||
$nodeDisplay = $node->getDisplay();
|
||||
if ($nodeDisplay > $oldDisplay) {
|
||||
$node->setDisplay($node->getDisplay() - 1);
|
||||
} elseif ($nodeDisplay === $oldDisplay) {
|
||||
break; // Stop immediately to not make things worse ;)
|
||||
if (! $config->hasBpNode($name)) {
|
||||
$config->removeNode($name);
|
||||
} else {
|
||||
$oldDisplay = $config->getBpNode($name)->getDisplay();
|
||||
$config->removeNode($name);
|
||||
if ($config->getMetadata()->isManuallyOrdered()) {
|
||||
foreach ($config->getRootNodes() as $_ => $node) {
|
||||
$nodeDisplay = $node->getDisplay();
|
||||
if ($nodeDisplay > $oldDisplay) {
|
||||
$node->setDisplay($node->getDisplay() - 1);
|
||||
} elseif ($nodeDisplay === $oldDisplay) {
|
||||
break; // Stop immediately to not make things worse ;)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue