Skip to content

Commit 91b55d5

Browse files
authored
Add isset an multiple_dropdown_action (#1001)
* Add isset * Update changelog * Fix add to assign
1 parent 72ec91f commit 91b55d5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [UNRELEASE]
99

10+
- FIx undefined array key `multiple_dropdown_action` during import
1011
- Fix incompatibility of `multiple` dropdowns with `massiveaction`
1112
- Fix default value properly applied in multiple dropdown search options
1213
- Fix `search option` for default values in `multiple` dropdown

inc/container.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ public function updateFieldsValues($data, $itemtype, $massiveaction = false)
12371237
$field_name = 'plugin_fields_' . $field_data['name'] . 'dropdowns_id';
12381238
}
12391239
if (array_key_exists($field_name, $data)) {
1240-
if ($data['multiple_dropdown_action'] === 'append' && $exist) {
1240+
if (isset($data['multiple_dropdown_action']) && $data['multiple_dropdown_action'] === 'append' && $exist) {
12411241
// Add new values to existing ones
12421242
$existing_values = json_decode($obj->fields[$field_name] ?? '[]', true);
12431243
$new_values = is_array($data[$field_name]) ? $data[$field_name] : [$data[$field_name]];
@@ -1831,7 +1831,7 @@ private static function populateData($c_id, CommonDBTM $item)
18311831
// ex my_dom[]
18321832
//in these conditions, the input is never sent by the browser
18331833
if ($field['multiple']) {
1834-
$data['multiple_dropdown_action'] = $_POST['multiple_dropdown_action'];
1834+
$data['multiple_dropdown_action'] = $_POST['multiple_dropdown_action'] ?? 'assign';
18351835
//handle multi dropdown field
18361836
if ($field['type'] == 'dropdown') {
18371837
$multiple_key = sprintf('plugin_fields_%sdropdowns_id', $field['name']);

0 commit comments

Comments
 (0)