From c06370d30836629fc5c594b54e07512aa43895c6 Mon Sep 17 00:00:00 2001 From: Gregory Chalenko Date: Thu, 6 May 2021 19:45:11 +0300 Subject: ..F....... [ZBXNEXT-114,ZBXNEXT-6572] fixed position of default type mapping for update --- ui/app/controllers/CControllerPopupValueMapUpdate.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ui') diff --git a/ui/app/controllers/CControllerPopupValueMapUpdate.php b/ui/app/controllers/CControllerPopupValueMapUpdate.php index cdf8d2388dd..7ad7c88a529 100644 --- a/ui/app/controllers/CControllerPopupValueMapUpdate.php +++ b/ui/app/controllers/CControllerPopupValueMapUpdate.php @@ -143,6 +143,7 @@ class CControllerPopupValueMapUpdate extends CController { protected function doAction() { $data = []; $mappings = []; + $default = []; $this->getInputs($data, ['valuemapid', 'name', 'mappings', 'edit']); foreach ($data['mappings'] as $mapping) { @@ -150,10 +151,19 @@ class CControllerPopupValueMapUpdate extends CController { $mapping['value'] === '' && $mapping['newvalue'] === '') { continue; } + elseif ($mapping['type'] == VALUEMAP_MAPPING_TYPE_DEFAULT) { + $default = $mapping; + + continue; + } $mappings[] = $mapping; } + if ($default) { + $mappings[] = $default; + } + $data['mappings'] = $mappings; $this->setResponse((new CControllerResponseData(['main_block' => json_encode($data)]))); } -- cgit v1.2.3