diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php index 08a87c7..96e124c 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php @@ -25,11 +25,11 @@ class TermAutocompleteController implements ControllerInterface { /** - * Entity query factor. + * Taxonomy term entity query interface. * * @var \Drupal\Core\Entity\Query\QueryInterface */ - protected $entityQuery; + protected $termEntityQuery; /** * Field info service. @@ -55,8 +55,8 @@ class TermAutocompleteController implements ControllerInterface { * @param \Drupal\taxonomy\TermStorageControllerInterface $termStorageController * The term storage controller. */ - public function __construct(QueryInterface $entityQuery, FieldInfo $fieldInfo, TermStorageControllerInterface $termStorageController) { - $this->entityQuery = $entityQuery; + public function __construct(QueryInterface $termEntityQuery, FieldInfo $fieldInfo, TermStorageControllerInterface $termStorageController) { + $this->termEntityQuery = $termEntityQuery; $this->fieldInfo = $fieldInfo; $this->termStorageController = $termStorageController; } @@ -66,7 +66,7 @@ public function __construct(QueryInterface $entityQuery, FieldInfo $fieldInfo, T */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.query'), + $container->get('entity.query')->get('taxonomy_term'), $container->get('field.info'), $container->get('plugin.manager.entity')->getStorageController('taxonomy_term') ); @@ -128,15 +128,14 @@ public function autocomplete(Request $request, $field_name) { $vids[] = $tree['vocabulary']; } - $query = $this->entityQuery->get('taxonomy_term'); - $query->addTag('term_access'); + $this->termEntityQuery->addTag('term_access'); // Do not select already entered terms. if (!empty($tags_typed)) { - $query->condition('name', $tags_typed, 'NOT IN'); + $this->termEntityQuery->condition('name', $tags_typed, 'NOT IN'); } // Select rows that match by term name. - $tids = $query + $tids = $this->termEntityQuery ->condition('vid', $vids, 'IN') ->condition('name', $tag_last, 'CONTAINS') ->range(0, 10)