mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-05-28 04:34:08 -04:00
NodeMoveAction: Properly handle unbound nodes
This commit is contained in:
parent
98f2ed8f48
commit
f022c0f101
1 changed files with 3 additions and 2 deletions
|
|
@ -176,9 +176,9 @@ class NodeMoveAction extends NodeAction
|
|||
$config->addRootNode($name);
|
||||
|
||||
$i = 0;
|
||||
foreach ($newNodes as $_ => $newNode) {
|
||||
foreach ($newNodes as $newName => $newNode) {
|
||||
/** @var BpNode $newNode */
|
||||
if ($newNode->getDisplay() > 0) {
|
||||
if ($newNode->getDisplay() > 0 || $newName === $name) {
|
||||
$i += 1;
|
||||
if ($newNode->getDisplay() !== $i) {
|
||||
$newNode->setDisplay($i);
|
||||
|
|
@ -193,6 +193,7 @@ class NodeMoveAction extends NodeAction
|
|||
} else {
|
||||
if ($this->newParent !== null) {
|
||||
$config->removeRootNode($name);
|
||||
$node->setDisplay(0);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue