Skip to content

Commit

Permalink
Make autocomplete useable for fields without persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Oct 28, 2023
1 parent f95d921 commit be610c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/midcom/datamanager/extension/type/autocompleteType.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
public function finishView(FormView $view, FormInterface $form, array $options)
{
$preset = [];
if (!empty($view->children['selection']->vars['data'])) {
if ( !empty($view->children['selection']->vars['data'])
&& !empty($options['widget_config']['class'])) {
foreach (array_filter((array) $view->children['selection']->vars['data']) as $identifier) {
if ($options['widget_config']['id_field'] == 'id') {
$identifier = (int) $identifier;
Expand Down

0 comments on commit be610c4

Please sign in to comment.