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 @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed

- Fix migration error caused by unknown itemtype in containers
- Fix empty default value in multiple dropdown fields

## [1.23.2] - 2025-12-22

Expand Down
4 changes: 3 additions & 1 deletion inc/container.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,9 @@ public function updateFieldsValues($data, $itemtype, $massiveaction = false)
$data[$field_name] = json_encode(array_values(array_unique(array_merge($existing_values, $new_values))));

} else {
$data[$field_name] = json_encode($data[$field_name]);
$value = $data[$field_name];
$value = is_array($value) ? $value : [];
$data[$field_name] = json_encode($value);
}
} elseif (array_key_exists('_' . $field_name . '_defined', $data)) {
$data[$field_name] = json_encode([]);
Expand Down
3 changes: 2 additions & 1 deletion inc/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,8 @@ public static function prepareHtmlFields(
// - either from a previous input (it will be an array).
//
// -> Decode it only if it is not already an array.
$value = json_decode((string) $value);
$decoded = json_decode((string) $value, true);
$value = is_array($decoded) ? $decoded : [];
}

$field['value'] = $value;
Expand Down