diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php index 694c171fde..a573a590f9 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php @@ -1217,6 +1217,7 @@ protected function processBaseTable(ContentEntityTypeInterface $entity_type, arr // And because the last installed entity type is used when building the // entity schema during field installation the entity type will not (yet) // have an ID key when the ID field is being installed. + // @todo Remove this in https://www.drupal.org/project/drupal/issues/2929120 if ($entity_type->hasKey('id')) { $this->processIdentifierSchema($schema, $entity_type->getKey('id')); } diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php index bf3fd46eb6..d7e23a1d87 100644 --- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php @@ -327,6 +327,14 @@ public function testOnEntityTypeCreate() { $this->entityType->expects($this->once()) ->method('getKeys') ->will($this->returnValue(['id' => 'id'])); + $this->entityType->expects($this->any()) + ->method('hasKey') + ->will($this->returnValueMap([ + // SqlContentEntityStorageSchema::initializeBaseTable() + ['revision', FALSE], + // SqlContentEntityStorageSchema::processBaseTable() + ['id', TRUE], + ])); $this->entityType->expects($this->any()) ->method('getKey') ->will($this->returnValueMap([