diff options
author | Miks Kronkalns <miks.kronkalns@zabbix.com> | 2022-06-17 10:19:56 +0300 |
---|---|---|
committer | Miks Kronkalns <miks.kronkalns@zabbix.com> | 2022-06-17 10:32:24 +0300 |
commit | d6c72838b6dfc9d69d072e6a6da8ba112d23f1d5 (patch) | |
tree | c8288f195e7e5fdbc57114d8b96acfb36d235d14 | |
parent | 227933621a721b3d593faee7c4864b4faf0587b6 (diff) |
..F....... [ZBX-21185] fixed pattern selector when item name contains square brackets
Merge in ZBX/zabbix from feature/ZBX-21185-6.1 to master
* commit 'b74c96209b321e9d1ff7addae49d62996a7a6242':
..F....... [ZBX-21185] fixed pattern selector when item name contains square brackets
(cherry picked from commit d5c14d1351c9b616776fd8ff37a3e63fde9d92b7)
-rw-r--r-- | ChangeLog.d/bugfix/ZBX-21185 | 1 | ||||
-rw-r--r-- | ui/app/controllers/CControllerPopupGeneric.php | 2 | ||||
-rw-r--r-- | ui/app/views/popup.generic.php | 8 |
3 files changed, 6 insertions, 5 deletions
diff --git a/ChangeLog.d/bugfix/ZBX-21185 b/ChangeLog.d/bugfix/ZBX-21185 new file mode 100644 index 00000000000..8d2de696133 --- /dev/null +++ b/ChangeLog.d/bugfix/ZBX-21185 @@ -0,0 +1 @@ +..F....... [ZBX-21185] fixed pattern selector when item name contains square brackets (miks) diff --git a/ui/app/controllers/CControllerPopupGeneric.php b/ui/app/controllers/CControllerPopupGeneric.php index 04cc5ed6ee1..09afd19ec0b 100644 --- a/ui/app/controllers/CControllerPopupGeneric.php +++ b/ui/app/controllers/CControllerPopupGeneric.php @@ -902,7 +902,7 @@ class CControllerPopupGeneric extends CController { case 'items': foreach ($records as $itemid => $row) { - $records[$row['name']] = ['itemid' => $row['name']] + $row; + $records[$row['name']] = ['pattern' => $row['name']] + $row; unset($records[$itemid]); } break; diff --git a/ui/app/views/popup.generic.php b/ui/app/views/popup.generic.php index 017049ba943..76d2a9533af 100644 --- a/ui/app/views/popup.generic.php +++ b/ui/app/views/popup.generic.php @@ -455,14 +455,14 @@ switch ($data['popup_type']) { $table->addRow([ $data['multiselect'] - ? new CCheckBox('item['.$item[$options['srcfld1']].']', $item['itemid']) + ? new CCheckBox('item['.$item['itemid'].']', $item['pattern']) : null, (new CLink($item['name'], 'javascript:void(0);')) ->onClick('javascript: addValue('. json_encode($options['reference']).', '. - json_encode($item['itemid']).', '. + json_encode($item['pattern']).', '. $options['parentid']. - ');'.$js_action_onclick), + ');'.$js_action_onclick), (new CDiv($item['key_']))->addClass(ZBX_STYLE_WORDWRAP), item_type2str($item['type']), itemValueTypeString($item['value_type']), @@ -473,7 +473,7 @@ switch ($data['popup_type']) { ]); $item = [ - 'id' => $item['itemid'], + 'id' => $item['pattern'], 'itemid' => $item['itemid'], 'name' => $options['patternselect'] ? $item['name'] |