Skip to content

Commit 2d726c9

Browse files
committed
refactor(dropdownfield): better use of GLPI API
Signed-off-by: Thierry Bugier <[email protected]>
1 parent 080271a commit 2d726c9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

inc/fields/dropdownfield.class.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ public function getDesignSpecializationField() {
6060
}
6161

6262
$optgroup = Dropdown::getStandardDropdownItemTypes();
63-
array_unshift($optgroup, '---');
6463
$field = '<div id="dropdown_values_field">';
6564
$field .= Dropdown::showFromArray('dropdown_values', $optgroup, [
66-
'value' => $itemtype,
67-
'rand' => $rand,
68-
'on_change' => 'plugin_formcreator_changeDropdownItemtype("' . $rand . '");',
69-
'display' => false,
65+
'value' => $itemtype,
66+
'rand' => $rand,
67+
'on_change' => 'plugin_formcreator_changeDropdownItemtype("' . $rand . '");',
68+
'display_emptychoice' => true,
69+
'display' => false,
7070
]);
7171

7272
$decodedValues = json_decode($this->question->fields['values'], JSON_OBJECT_AS_ARRAY);

0 commit comments

Comments
 (0)