|
112 | 112 | {% set dropdown_itemtype = call("PluginFieldsDropdown::getClassname", [name]) %} |
113 | 113 | {% endif %} |
114 | 114 | {% set name_fk = call("getForeignKeyFieldForItemType", [dropdown_itemtype]) %} |
115 | | - {{ macros.dropdownField(dropdown_itemtype, name_fk, value, label, field_options|merge(dropdown_options)) }} |
| 115 | + {{ macros.dropdownField(dropdown_itemtype, name_fk, value, label, field_options|merge(dropdown_options|default({}))) }} |
116 | 116 |
|
117 | 117 | {% elseif type matches '/^dropdown-.+/i' %} |
118 | | - {% set dropdown_options = {'condition': field['dropdown_condition'], 'entity': item.getEntityID()} %} |
| 118 | + {% set dropdown_options = {'entity': item.getEntityID()} %} |
| 119 | + {% if field['dropdown_condition'] is defined and field['dropdown_condition']|length %} |
| 120 | + {% set dropdown_options = dropdown_options|merge({'condition': field['dropdown_condition']}) %} |
| 121 | + {% endif %} |
119 | 122 | {% if field['dropdown_class'] == 'User' %} |
120 | 123 | {% set dropdown_options = dropdown_options|merge({'entity': -1, 'right': 'all'}) %} |
121 | 124 | {% elseif field['dropdown_class'] == 'Entity' or item.isRecursive() %} |
|
124 | 127 | {% if field['multiple'] %} |
125 | 128 | {% set dropdown_options = dropdown_options|merge({'multiple': true}) %} |
126 | 129 | {% endif %} |
127 | | - {{ macros.dropdownField(field['dropdown_class'], name, value, label, field_options|merge(dropdown_options)) }} |
| 130 | + {{ macros.dropdownField(field['dropdown_class'], name, value, label, field_options|merge(dropdown_options|default({}))) }} |
128 | 131 |
|
129 | 132 | {% elseif type == 'glpi_item' %} |
130 | 133 | {% if not massiveaction %} |
|
0 commit comments