mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-05-28 04:34:08 -04:00
NodeMoveAction: Don't allow to accidentally override the placement of nodes
This commit is contained in:
parent
3146bfda6a
commit
da4bf7ffc6
1 changed files with 10 additions and 0 deletions
|
|
@ -103,6 +103,12 @@ class NodeMoveAction extends NodeAction
|
|||
if ($this->newParent !== null) {
|
||||
if (! $config->hasBpNode($this->newParent)) {
|
||||
$this->error('New parent process "%s" missing', $this->newParent);
|
||||
} elseif ($config->getBpNode($this->newParent)->hasChild($name)) {
|
||||
$this->error(
|
||||
'New parent process "%s" already has a node with the name "%s"',
|
||||
$this->newParent,
|
||||
$name
|
||||
);
|
||||
}
|
||||
|
||||
$childrenCount = $config->getBpNode($this->newParent)->countChildren();
|
||||
|
|
@ -114,6 +120,10 @@ class NodeMoveAction extends NodeAction
|
|||
);
|
||||
}
|
||||
} else {
|
||||
if ($config->hasRootNode($name)) {
|
||||
$this->error('Process "%s" is already a toplevel process', $name);
|
||||
}
|
||||
|
||||
$childrenCount = $config->countChildren();
|
||||
if ($this->to > 0 && $childrenCount < $this->to) {
|
||||
$this->error(
|
||||
|
|
|
|||
Loading…
Reference in a new issue