Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions inc/container.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]];
Expand Down Expand Up @@ -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']);
Expand Down