Skip to content

Commit

Permalink
handler url can now be overwritten in config
Browse files Browse the repository at this point in the history
  • Loading branch information
gudd committed Apr 16, 2019
1 parent 4f57543 commit 9e3a221
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/midcom/datamanager/extension/type/autocompleteType.php
Expand Up @@ -50,6 +50,7 @@ public function configureOptions(OptionsResolver $resolver)
'categorize_by_parent_label' => false,
'searchfields' => [],
'min_chars' => 2,
'handler_url' => midcom_connection::get_url('self') . 'midcom-exec-midcom.datamanager/autocomplete.php',
'sortable' => false,
'clever_class' => null
];
Expand Down Expand Up @@ -122,8 +123,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
*/
public function finishView(FormView $view, FormInterface $form, array $options)
{
$handler_url = midcom_connection::get_url('self') . 'midcom-exec-midcom.datamanager/autocomplete.php';

$preset = [];
if (!empty($view->children['selection']->vars['data'])) {
foreach (array_filter((array) $view->children['selection']->vars['data']) as $identifier) {
Expand All @@ -140,7 +139,6 @@ public function finishView(FormView $view, FormInterface $form, array $options)
}

$handler_options = array_replace([
'handler_url' => $handler_url,
'method' => $options['type_config']['method'],
'allow_multiple' => $options['type_config']['allow_multiple'],
'preset' => $preset,
Expand Down

0 comments on commit 9e3a221

Please sign in to comment.