-
Problem report
-
Resolution: Fixed
-
Trivial
-
4.0.43rc1, 5.0.26rc1, 6.0.7rc1, 6.2.1rc1, 6.4.0alpha1
-
Sprint 90 (Jul 2022), Sprint 91 (Aug 2022), Sprint 92 (Sep 2022)
-
0.5
Problem description: If two templates, both of which have an item that populates the same inventory field, are linked to a host, then apart from an expected human readable error message, two additional errors are observed:
Undefined offset: 0 [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostUpdate->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CHost->update() → CHost->massUpdate() → CHost->massAdd() → CHostGeneral->massAdd() → CHostGeneral->link() → CItem->syncTemplates() → CItemGeneral->inherit() → CItemGeneral->_inherit() → CItem::validateInventoryLinks() in include/classes/api/services/CItem.php:1016] Trying to access array offset on value of type null [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostUpdate->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CHost->update() → CHost->massUpdate() → CHost->massAdd() → CHostGeneral->massAdd() → CHostGeneral->link() → CItem->syncTemplates() → CItemGeneral->inherit() → CItemGeneral->_inherit() → CItem::validateInventoryLinks() in include/classes/api/services/CItem.php:1016] Two items ("Host name" and "") cannot populate one host inventory field "Name", this would lead to a conflict.
Steps to reproduce:
- Create a host
- Create two templates - each template should have an item that populates inventory field "Name"
- Open its configuration and link the following templates:
- Link both created templates to this host
- Attempt to save host configuration
Result: the above three error messages are observed
Expected: only the following error message should be observed:
Two items ("Host name" and "") cannot populate one host inventory field "Name", this would lead to a conflict.