Skip to content
Snippets Groups Projects

Issue #3373905: Drupal 10 Compatibility

3 files
+ 10
15
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -30,19 +30,16 @@ class AlterEntityAutocompleteMatcher extends EntityAutocompleteMatcher {
protected $entityTypeManager;
/**
* The entity query.
* Constructs a AlterEntityAutocompleteMatcher object.
*
* @var \Drupal\Core\Entity\Query\QueryInterface
* @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory
* The config factory service.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* The entity type manager service.
*/
protected $entityQuery;
/**
* {@inheritDoc}
*/
public function __construct(ConfigFactoryInterface $configFactory, EntityTypeManagerInterface $entityTypeManager, QueryInterface $entityQuery) {
public function __construct(ConfigFactoryInterface $configFactory, EntityTypeManagerInterface $entityTypeManager) {
$this->configFactory = $configFactory;
$this->entityTypeManager = $entityTypeManager;
$this->entityQuery = $entityQuery;
}
/**
@@ -52,7 +49,6 @@ class AlterEntityAutocompleteMatcher extends EntityAutocompleteMatcher {
return new static(
$container->get('config.factory'),
$container->get('entity_type.manager'),
$container->get('entity.query.config')
);
}
@@ -84,14 +80,14 @@ class AlterEntityAutocompleteMatcher extends EntityAutocompleteMatcher {
$selected_roles[] = $role;
}
}
$query = $this->entityQuery->get('user');
$query = $this->entityTypeManager->getStorage('user')->getQuery();
$query->condition('status', TRUE);
if (!empty($selected_roles)) {
$query->condition('roles', $selected_roles, 'IN');
}
$query->condition($target_entity_field, '%' . Database::getConnection()->escapeLike($string) . '%', 'LIKE');
$query->range(0, $match_limit);
$result = $query->execute();
$result = $query->accessCheck(TRUE)->execute();
if (empty($result)) {
return [];
Loading