-
Incident report
-
Resolution: Fixed
-
Minor
-
3.0.0beta2
'Undefined index: conditiontype' error when adding LLD rules with Filter conditions chained with AND:
Undefined index: conditiontype [host_discovery.php:315 ? CFrontendApiWrapper->update() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CDiscoveryRule->update() ? CDiscoveryRule->checkInput() ? CApiService->checkValidator() ? CSchemaValidator->validate() ? CConditionValidator->validate() in include/classes/validators/object/CConditionValidator.php:65] Undefined index: conditiontype [host_discovery.php:315 ? CFrontendApiWrapper->update() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CDiscoveryRule->update() ? CDiscoveryRule->checkInput() ? CApiService->checkValidator() ? CSchemaValidator->validate() ? CConditionValidator->validate() in include/classes/validators/object/CConditionValidator.php:65]
To reproduce:
1. Go to default template with LLD, like Template SNMP Interfaces
2. Define two Filters in 'Network interfaces' discovery:
3. Type of calculation choose And instead of And/Or
4. Click Details to see the error
5. To repeat the problem change Type of calculation back to And/Or, Update, and then back to And.
6. Issue can be also seen when reimporting the template containing such discovery
P.S.
Contents of var_dump($object) in validate function:
array(2) { ["evaltype"]=> string(1) "1" ["conditions"]=> array(2) { [0]=> array(3) { ["formulaid"]=> string(1) "A" ["macro"]=> string(12) "{#SNMPINDEX}
" ["value"]=> string(1) "1" } [1]=> array(3) { ["formulaid"]=> string(1) "B" ["macro"]=> string(12) "
{#SNMPVALUE}" ["value"]=> string(1) "2" } } }