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) {
340340 if ($ itemtype != Entity::class) {
341341 $ dparams ['display_emptychoice ' ] = ($ this ->question ->fields ['show_empty ' ] !== '0 ' );
342342 } else {
343- if ($ this ->question ->fields ['show_empty ' ] !== '0 ' ) {
343+ if ($ this ->question ->fields ['show_empty ' ] != '0 ' ) {
344344 $ dparams ['toadd ' ] = [
345345 -1 => Dropdown::EMPTY_VALUE ,
346346 ];
Original file line number Diff line number Diff line change 6262 ) }}
6363
6464 {% 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 %}
6572 {{ fields.dropdownField (
6673 item .fields ['itemtype' ],
6774 ' default_values' ,
68- item . fields [ ' default_values' ] ,
75+ default_values ,
6976 __(' Default values' ), {
7077 label_class : ' col-xxl-4' ,
7178 input_class : ' col-xxl-8' ,
79+ toadd : to_add ,
7280 }
7381 ) }}
7482 {% else %}
You can’t perform that action at this time.
0 commit comments