Skip to content

Commit ec12df5

Browse files
stonebuzzRom1-B
andauthored
Fix default value dropdown object (#1088)
* Fix(Fields): fix default value format for multiple dropdown (GLPIObject) * adapt changelog.md --------- Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
1 parent ed80846 commit ec12df5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Fixed
1111

12+
- Fix default value format for multiple dropdown (GLPIObject)
13+
- Fix bad SQL query for `GenericObject`
1214
- Fixed a bug that prevented the creation of additional field data for objects
1315
- Hide config menu if user does not have read permission
1416

inc/field.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function prepareInputForAdd($input)
252252
$input['name'] = $this->prepareName($input);
253253

254254
if ($input['multiple'] ?? false) {
255-
$input['default_value'] = json_encode($input['default_value'] ?? []);
255+
$input['default_value'] = json_encode($input['default_value'] ?: []);
256256
}
257257

258258
//reject adding when field name is too long for mysql

0 commit comments

Comments
 (0)