diff options
-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)]))); } |