From dfdfc26bd568311846c27878d0b1b814517998af Mon Sep 17 00:00:00 2001 From: Kristiaan Van den Eynde Date: Mon, 29 Jun 2020 11:45:45 +0200 Subject: [PATCH] interdiff --- entity.module | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/entity.module b/entity.module index 62f404e..e067d8e 100644 --- a/entity.module +++ b/entity.module @@ -6,6 +6,7 @@ */ use Drupal\Core\Access\AccessResult; +use Drupal\Core\Config\Entity\ConfigEntityInterface; use Drupal\Core\Database\Query\SelectInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeInterface; @@ -72,10 +73,13 @@ function entity_entity_type_build(array &$entity_types) { */ function entity_entity_type_alter(array &$entity_types) { /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */ - // Sets a default query_access handler for all entity types that have none. foreach ($entity_types as $entity_type_id => $entity_type) { + // Sets a default query_access handler for all entity types that have none. if (!$entity_type->hasHandlerClass('query_access')) { - $entity_type->setHandlerClass('query_access', 'Drupal\entity\QueryAccess\EventOnlyQueryAccessHandler'); + // Query access does not apply to config entities. + if (!$entity_type->entityClassImplements(ConfigEntityInterface::class)) { + $entity_type->setHandlerClass('query_access', 'Drupal\entity\QueryAccess\EventOnlyQueryAccessHandler'); + } } } } -- 2.17.1