mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-20 23:00:16 -05:00
NoDuplicateChildrenValidator: Don't detect a no-change as duplicate
This commit is contained in:
parent
67a7687606
commit
8f868d79c9
1 changed files with 3 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ namespace Icinga\Module\Businessprocess\Web\Form\Validator;
|
||||||
|
|
||||||
use Icinga\Module\Businessprocess\BpConfig;
|
use Icinga\Module\Businessprocess\BpConfig;
|
||||||
use Icinga\Module\Businessprocess\BpNode;
|
use Icinga\Module\Businessprocess\BpNode;
|
||||||
|
use Icinga\Module\Businessprocess\Forms\EditNodeForm;
|
||||||
use Icinga\Module\Businessprocess\Web\Form\QuickForm;
|
use Icinga\Module\Businessprocess\Web\Form\QuickForm;
|
||||||
use Zend_Validate_Abstract;
|
use Zend_Validate_Abstract;
|
||||||
|
|
||||||
|
|
@ -39,6 +40,8 @@ class NoDuplicateChildrenValidator extends Zend_Validate_Abstract
|
||||||
{
|
{
|
||||||
if ($this->parent === null) {
|
if ($this->parent === null) {
|
||||||
$found = $this->bp->hasRootNode($value);
|
$found = $this->bp->hasRootNode($value);
|
||||||
|
} elseif ($this->form instanceof EditNodeForm && $this->form->getNode()->getName() === $value) {
|
||||||
|
$found = false;
|
||||||
} else {
|
} else {
|
||||||
$found = $this->parent->hasChild($value);
|
$found = $this->parent->hasChild($value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue