diff --git a/CHANGELOG.md b/CHANGELOG.md index 54fb349d..ffddf79b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [UNRELEASE] +- FIx undefined array key `multiple_dropdown_action` during import - Fix incompatibility of `multiple` dropdowns with `massiveaction` - Fix default value properly applied in multiple dropdown search options - Fix `search option` for default values in `multiple` dropdown diff --git a/inc/container.class.php b/inc/container.class.php index ff7b1a57..d6750d44 100644 --- a/inc/container.class.php +++ b/inc/container.class.php @@ -1237,7 +1237,7 @@ public function updateFieldsValues($data, $itemtype, $massiveaction = false) $field_name = 'plugin_fields_' . $field_data['name'] . 'dropdowns_id'; } if (array_key_exists($field_name, $data)) { - if ($data['multiple_dropdown_action'] === 'append' && $exist) { + if (isset($data['multiple_dropdown_action']) && $data['multiple_dropdown_action'] === 'append' && $exist) { // Add new values to existing ones $existing_values = json_decode($obj->fields[$field_name] ?? '[]', true); $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) // ex my_dom[] //in these conditions, the input is never sent by the browser if ($field['multiple']) { - $data['multiple_dropdown_action'] = $_POST['multiple_dropdown_action']; + $data['multiple_dropdown_action'] = $_POST['multiple_dropdown_action'] ?? 'assign'; //handle multi dropdown field if ($field['type'] == 'dropdown') { $multiple_key = sprintf('plugin_fields_%sdropdowns_id', $field['name']);