diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Taxonomy.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Taxonomy.php index 5ee7d89..345ad3e 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Taxonomy.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Taxonomy.php @@ -55,20 +55,12 @@ public function setContainer(ContainerInterface $container = NULL) { * * @param string $field_name * The name of the term reference field. - * @param string $tags_typed - * (optional) A comma-separated list of term names entered in the - * autocomplete form element. Only the last term is used for autocompletion. - * Defaults to '' (an empty string). * * @see taxonomy_menu() * @see taxonomy_field_widget_info() */ - public function autocomplete($field_name, $tags_typed = '') { - $args = arg(); - unset($args[0]); - unset($args[1]); - unset($args[2]); - $tags_typed = implode('/', $args); + public function autocomplete($field_name) { + $tags_typed = drupal_container()->get('request')->query->get('q'); // Make sure the field exists and is a taxonomy field. if (!($field = field_info_field($field_name)) || $field['type'] !== 'taxonomy_term_reference') { diff --git a/core/modules/taxonomy/taxonomy.routing.yml b/core/modules/taxonomy/taxonomy.routing.yml index 35c66fc..5cca0f5 100644 --- a/core/modules/taxonomy/taxonomy.routing.yml +++ b/core/modules/taxonomy/taxonomy.routing.yml @@ -1,7 +1,6 @@ taxonomy_autocomplete: - pattern: '/taxonomy/autocomplete/{field_name}/{tags_typed}' + pattern: '/taxonomy/autocomplete/{field_name}' defaults: _controller: '\Drupal\taxonomy\TaxonomyRouteController::autocomplete' requirements: _permission: 'access content' -