Issue #2306077 by dawehner: Fixed Get rid of connection in UserAutocomplete.
parent
c6cd9ac7f9
commit
29d0f4361d
|
@ -9,7 +9,6 @@ namespace Drupal\user;
|
|||
|
||||
use Drupal\Component\Utility\String;
|
||||
use Drupal\Core\Config\ConfigFactoryInterface;
|
||||
use Drupal\Core\Database\Connection;
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
use Drupal\Core\Entity\Query\QueryFactory;
|
||||
|
||||
|
@ -18,13 +17,6 @@ use Drupal\Core\Entity\Query\QueryFactory;
|
|||
*/
|
||||
class UserAutocomplete {
|
||||
|
||||
/**
|
||||
* The database connection to query for the user names.
|
||||
*
|
||||
* @var \Drupal\Core\Database\Connection
|
||||
*/
|
||||
protected $connection;
|
||||
|
||||
/**
|
||||
* The config factory to get the anonymous user name.
|
||||
*
|
||||
|
@ -49,13 +41,14 @@ class UserAutocomplete {
|
|||
/**
|
||||
* Constructs a UserAutocomplete object.
|
||||
*
|
||||
* @param \Drupal\Core\Database\Connection $connection
|
||||
* The database connection to query for the user names.
|
||||
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
|
||||
* The config factory.
|
||||
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
|
||||
* The entity manager.
|
||||
* @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
|
||||
* The entity query factory.
|
||||
*/
|
||||
public function __construct(Connection $connection, ConfigFactoryInterface $config_factory, EntityManagerInterface $entity_manager, QueryFactory $entity_query) {
|
||||
$this->connection = $connection;
|
||||
public function __construct(ConfigFactoryInterface $config_factory, EntityManagerInterface $entity_manager, QueryFactory $entity_query) {
|
||||
$this->configFactory = $config_factory;
|
||||
$this->entityQuery = $entity_query;
|
||||
$this->entityManager = $entity_manager;
|
||||
|
|
|
@ -35,7 +35,7 @@ services:
|
|||
arguments: ['@database']
|
||||
user.autocomplete:
|
||||
class: Drupal\user\UserAutocomplete
|
||||
arguments: ['@database', '@config.factory', '@entity.manager', '@entity.query']
|
||||
arguments: ['@config.factory', '@entity.manager', '@entity.query']
|
||||
user_maintenance_mode_subscriber:
|
||||
class: Drupal\user\EventSubscriber\MaintenanceModeSubscriber
|
||||
arguments: ['@maintenance_mode', '@current_user']
|
||||
|
|
Loading…
Reference in New Issue