Skip to content

Commit

Permalink
Allow select2 without entity reference (#4043) (#4044)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-korn authored Nov 6, 2023
1 parent 2be99b4 commit d80a091
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/json_form_widget/src/WidgetRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function getDropdownElement($element, $spec, $titleProperty = FALSE) {
$element['#multiple'] = isset($spec->multiple) ? TRUE : FALSE;
$element['#autocreate'] = isset($spec->allowCreate) ? TRUE : FALSE;
}
if (isset($element['#autocreate'])) {
if (isset($element['#autocreate']) && $spec->type !== 'select2') {
$element['#target_type'] = 'node';
}
return $element;
Expand All @@ -204,7 +204,7 @@ public function getSelectType($spec) {
if (isset($spec->type) && $spec->type === 'select_other') {
return 'select_or_other_select';
}
elseif (isset($spec->type) && $spec->type === 'autocomplete') {
elseif (isset($spec->type) && ($spec->type === 'autocomplete' || $spec->type === 'select2')) {
return 'select2';
}
return 'select';
Expand Down

0 comments on commit d80a091

Please sign in to comment.