diff --git a/core/modules/views/src/ViewsConfigUpdater.php b/core/modules/views/src/ViewsConfigUpdater.php index 39007783e69..88442d46ddc 100644 --- a/core/modules/views/src/ViewsConfigUpdater.php +++ b/core/modules/views/src/ViewsConfigUpdater.php @@ -8,6 +8,7 @@ use Drupal\Core\Config\TypedConfigManagerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\EntityFieldManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Entity\Sql\DefaultTableMapping; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -343,7 +344,7 @@ class ViewsConfigUpdater implements ContainerInjectionInterface { $table_info = []; foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) { - if ($entity_type->hasHandlerClass('views_data')) { + if ($entity_type->hasHandlerClass('views_data') && $entity_type->entityClassImplements(FieldableEntityInterface::class)) { $base_field_definitions = $this->entityFieldManager->getBaseFieldDefinitions($entity_type_id); $entity_storage = $this->entityTypeManager->getStorage($entity_type_id); diff --git a/core/modules/views/tests/modules/views_config_entity_test/config/schema/views_config_entity_test.schema.yml b/core/modules/views/tests/modules/views_config_entity_test/config/schema/views_config_entity_test.schema.yml new file mode 100644 index 00000000000..8ea57d87597 --- /dev/null +++ b/core/modules/views/tests/modules/views_config_entity_test/config/schema/views_config_entity_test.schema.yml @@ -0,0 +1,9 @@ +views_config_entity_test.type.*: + type: config_entity + label: 'Config entity type with Views data' + mapping: + id: + type: string + name: + type: label + label: 'Name' diff --git a/core/modules/views/tests/modules/views_config_entity_test/src/Entity/ViewsConfigEntityTest.php b/core/modules/views/tests/modules/views_config_entity_test/src/Entity/ViewsConfigEntityTest.php new file mode 100644 index 00000000000..2649e76ad4e --- /dev/null +++ b/core/modules/views/tests/modules/views_config_entity_test/src/Entity/ViewsConfigEntityTest.php @@ -0,0 +1,26 @@ +