Skip to content

Commit

Permalink
Allow overriding more settings
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Apr 9, 2019
1 parent 86bed66 commit 9852891
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/midcom/datamanager/extension/type/autocompleteType.php
Expand Up @@ -139,13 +139,16 @@ public function finishView(FormView $view, FormInterface $form, array $options)
}
}

$handler_options = $options['widget_config'];
$handler_options = array_replace([
'handler_url' => $handler_url,
'method' => $options['type_config']['method'],
'allow_multiple' => $options['type_config']['allow_multiple'],
'preset' => $preset,
'preset_order' => array_reverse(array_keys($preset))
], $options['widget_config']);

// @todo widget_config constraints are ignored, but they are used in the wild...
$handler_options['constraints'] = $options['type_config']['constraints'];
$handler_options['handler_url'] = $handler_url;
$handler_options['method'] = $options['type_config']['method'];
$handler_options['allow_multiple'] = $options['type_config']['allow_multiple'];
$handler_options['preset'] = $preset;
$handler_options['preset_order'] = array_reverse(array_keys($preset));

$view->vars['min_chars'] = $options['widget_config']['min_chars'];
$view->vars['handler_options'] = json_encode($handler_options);
Expand Down

0 comments on commit 9852891

Please sign in to comment.