diff options
author | Vladimirs Maksimovs <vladimirs.maksimovs@zabbix.com> | 2022-05-24 15:54:29 +0300 |
---|---|---|
committer | Vladimirs Maksimovs <vladimirs.maksimovs@zabbix.com> | 2022-05-24 15:54:29 +0300 |
commit | f8700a3523bfdc5518085810948adc10bf6e2e2a (patch) | |
tree | c3bed1d0ba4e8ffef2756262a4c7ed3f852004ac /ui/app | |
parent | 31792916df4bcd276580318ee327752f6311a5ba (diff) |
A.F....... [ZBX-20613] returned the ability to edit the dependencies of inherited triggers; improved validation upon unlinking templates with triggers that have dependencies; improved performance of trigger dependency functionality; prevented the ability to fully replace trigger dependencies of inherited triggers if the new dependency was added to parent trigger; supplemented validation of trigger dependencies on templates to prevent linkage dead-ends
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/controllers/CControllerHostCreate.php | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/ui/app/controllers/CControllerHostCreate.php b/ui/app/controllers/CControllerHostCreate.php index 89565b41cd9..c7f835922d0 100644 --- a/ui/app/controllers/CControllerHostCreate.php +++ b/ui/app/controllers/CControllerHostCreate.php @@ -106,11 +106,11 @@ class CControllerHostCreate extends CControllerHostUpdateGeneral { $host = $this->extendHostCloneEncryption($host, $src_hostid); } - $hostids = API::Host()->create($host); + $result = API::Host()->create($host); - if ($hostids === false - || !$this->createValueMaps($hostids['hostids'][0]) - || ($full_clone && !$this->copyFromCloneSourceHost($src_hostid, $hostids['hostids'][0]))) { + if ($result === false + || !$this->createValueMaps($result['hostids'][0]) + || ($full_clone && !$this->copyFromCloneSourceHost($src_hostid, $result['hostids'][0]))) { throw new Exception(); } @@ -210,14 +210,7 @@ class CControllerHostCreate extends CControllerHostUpdateGeneral { } // Copy triggers. - $db_triggers = API::Trigger()->get([ - 'output' => ['triggerid'], - 'hostids' => $src_hostid, - 'inherited' => false, - 'filter' => ['flags' => ZBX_FLAG_DISCOVERY_NORMAL] - ]); - - if ($db_triggers && !copyTriggersToHosts(array_column($db_triggers, 'triggerid'), $hostid, $src_hostid)) { + if (!copyTriggersToHosts([$hostid], $src_hostid)) { return false; } |