diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php index d5576ae..6288323 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php @@ -552,7 +552,7 @@ protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $res // Add an index for the 'published' entity key. if (is_subclass_of($entity_type->getClass(), EntityPublishedInterface::class)) { $published_key = $entity_type->getKey('published'); - if (!$storage_definitions[$published_key]->hasCustomStorage()) { + if ($published_key && !$storage_definitions[$published_key]->hasCustomStorage()) { $published_field_table = $table_mapping->getFieldTableName($published_key); $id_key = $entity_type->getKey('id'); if ($bundle_key = $entity_type->getKey('bundle')) {