File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ public function buildParams($rand = null) {
340
340
if ($ itemtype != Entity::class) {
341
341
$ dparams ['display_emptychoice ' ] = ($ this ->question ->fields ['show_empty ' ] !== '0 ' );
342
342
} else {
343
- if ($ this ->question ->fields ['show_empty ' ] !== '0 ' ) {
343
+ if ($ this ->question ->fields ['show_empty ' ] != '0 ' ) {
344
344
$ dparams ['toadd ' ] = [
345
345
-1 => Dropdown::EMPTY_VALUE ,
346
346
];
Original file line number Diff line number Diff line change 62
62
) }}
63
63
64
64
{% if item .fields ['itemtype' ] is defined and item .fields ['itemtype' ] != ' 0' %}
65
+ {% set to_add = {} %}
66
+ {% if item .fields ['itemtype' ] == ' Entity' %}
67
+ {% set default_values = item .fields ['default_values' ] == ' ' ? -1 : item .fields ['default_values' ] %}
68
+ {% set to_add = {
69
+ ' -1' : constant (' Dropdown::EMPTY_VALUE' ),
70
+ } %}
71
+ {% endif %}
65
72
{{ fields.dropdownField (
66
73
item .fields ['itemtype' ],
67
74
' default_values' ,
68
- item . fields [ ' default_values' ] ,
75
+ default_values ,
69
76
__(' Default values' ), {
70
77
label_class : ' col-xxl-4' ,
71
78
input_class : ' col-xxl-8' ,
79
+ toadd : to_add ,
72
80
}
73
81
) }}
74
82
{% else %}
You can’t perform that action at this time.
0 commit comments