diff options
author | Gregory Chalenko <gregory.chalenko@zabbix.com> | 2021-05-06 19:45:11 +0300 |
---|---|---|
committer | Gregory Chalenko <gregory.chalenko@zabbix.com> | 2021-05-06 19:45:11 +0300 |
commit | c06370d30836629fc5c594b54e07512aa43895c6 (patch) | |
tree | 60b278b13e0b52f1f7e6ba0e1d1033c6f660fb79 /ui | |
parent | 87ae4c1731db79031687c6a5068e0fe529ef810c (diff) |
..F....... [ZBXNEXT-114,ZBXNEXT-6572] fixed position of default type mapping for update
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/controllers/CControllerPopupValueMapUpdate.php | 10 |
1 files changed, 10 insertions, 0 deletions
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)]))); } |