diff options
author | Alexander Vladishev <aleksander.vladishev@zabbix.com> | 2022-05-24 20:32:27 +0300 |
---|---|---|
committer | Alexander Vladishev <aleksander.vladishev@zabbix.com> | 2022-05-24 20:32:27 +0300 |
commit | ed570e4843186cf4900524f3a0f87bcfbf2896b8 (patch) | |
tree | 17c308daac14dd0a325b644819212a800145c4d0 | |
parent | fd415e04e052b18dc9575aade92f3accacc8529a (diff) |
A......... [ZBX-20859] fixed import of the graphs with ymin_type_1 and ymax_type_2 fields with default value
-rw-r--r-- | ui/include/classes/import/validators/C60XmlValidator.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/include/classes/import/validators/C60XmlValidator.php b/ui/include/classes/import/validators/C60XmlValidator.php index aeee7dceaad..4aa6052a222 100644 --- a/ui/include/classes/import/validators/C60XmlValidator.php +++ b/ui/include/classes/import/validators/C60XmlValidator.php @@ -2293,7 +2293,9 @@ class C60XmlValidator extends CXmlValidatorGeneral { * @return array */ public function getYMinItemExtendedRules(array $data): array { - return $data['ymin_type_1'] == GRAPH_YAXIS_TYPE_ITEM_VALUE || $data['ymin_type_1'] == CXmlConstantName::ITEM + $ymin_type_1 = array_key_exists('ymin_type_1', $data) ? $data['ymin_type_1'] : GRAPH_YAXIS_TYPE_CALCULATED; + + return $ymin_type_1 == GRAPH_YAXIS_TYPE_ITEM_VALUE || $ymin_type_1 == CXmlConstantName::ITEM ? ['type' => XML_ARRAY, 'rules' => [ 'host' => ['type' => XML_STRING | XML_REQUIRED], 'key' => ['type' => XML_STRING | XML_REQUIRED] @@ -2307,7 +2309,9 @@ class C60XmlValidator extends CXmlValidatorGeneral { * @return array */ public function getYMaxItemExtendedRules(array $data): array { - return $data['ymax_type_1'] == GRAPH_YAXIS_TYPE_ITEM_VALUE || $data['ymax_type_1'] == CXmlConstantName::ITEM + $ymax_type_1 = array_key_exists('ymax_type_1', $data) ? $data['ymax_type_1'] : GRAPH_YAXIS_TYPE_CALCULATED; + + return $ymax_type_1 == GRAPH_YAXIS_TYPE_ITEM_VALUE || $ymax_type_1 == CXmlConstantName::ITEM ? ['type' => XML_ARRAY, 'rules' => [ 'host' => ['type' => XML_STRING | XML_REQUIRED], 'key' => ['type' => XML_STRING | XML_REQUIRED] |