In the user.autocomplete service is injected the database service, but it isn't used there.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

skipyT’s picture

I removed the parameter from the services file and I updated the constructor also.

skipyT’s picture

Status: Active » Needs review
dawehner’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Quickfix

Nice! This is an easy one!

claudiu.cristea’s picture

Status: Reviewed & tested by the community » Needs work

The property has been left inside. Remove this:

  /**
   * The database connection to query for the user names.
   *
   * @var \Drupal\Core\Database\Connection
   */
  protected $connection;

The last submitted patch, 1: 2227391-autocomplete-without-db-service-1.patch, failed testing.

skipyT’s picture

Status: Needs work » Needs review
FileSize
2.33 KB
566 bytes

Thanks Claudiu!
Deleted the unused class property.

claudiu.cristea’s picture

Status: Needs review » Reviewed & tested by the community

RTBC if turns green.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

This looks great.

+++ b/core/modules/user/lib/Drupal/user/UserAutocomplete.php
@@ -49,13 +41,14 @@ class UserAutocomplete {
+   * @param \Drupal\Core\Entity\EntityManager $entity_manager
+   *   The entity manager.
...
+  public function __construct(ConfigFactoryInterface $config_factory, EntityManager $entity_manager, QueryFactory $entity_query) {

If we're fixing the constructor let's also change EntityManager to EntityManagerInterface.

skipyT’s picture

Status: Needs work » Needs review
FileSize
2.73 KB
3.6 KB

modified the queryfactory to be an interface and rerolled the patch.

Status: Needs review » Needs work

The last submitted patch, 9: 2227391-autocomplete-without-db-service-7.patch, failed testing.

skipyT’s picture

Status: Needs work » Closed (duplicate)

this seems it was fixed in #2306077. Closing this.