diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index 0c58b0d31a..e7c235d76d 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -1286,27 +1286,23 @@ protected function getEntityKey($key) { */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields = []; - if ($entity_type->hasKey('id')) { $fields[$entity_type->getKey('id')] = BaseFieldDefinition::create('integer') ->setLabel(new TranslatableMarkup('ID')) ->setReadOnly(TRUE) ->setSetting('unsigned', TRUE); } - if ($entity_type->hasKey('uuid')) { $fields[$entity_type->getKey('uuid')] = BaseFieldDefinition::create('uuid') ->setLabel(new TranslatableMarkup('UUID')) ->setReadOnly(TRUE); } - - if ($entity_type->isRevisionable()) { + if ($entity_type->hasKey('revision')) { $fields[$entity_type->getKey('revision')] = BaseFieldDefinition::create('integer') ->setLabel(new TranslatableMarkup('Revision ID')) ->setReadOnly(TRUE) ->setSetting('unsigned', TRUE); } - if ($entity_type->hasKey('langcode')) { $fields[$entity_type->getKey('langcode')] = BaseFieldDefinition::create('language') ->setLabel(new TranslatableMarkup('Language')) @@ -1324,7 +1320,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields[$entity_type->getKey('langcode')]->setTranslatable(TRUE); } } - if ($entity_type->hasKey('bundle')) { if ($bundle_entity_type_id = $entity_type->getBundleEntityType()) { $fields[$entity_type->getKey('bundle')] = BaseFieldDefinition::create('entity_reference') diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchemaConverter.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchemaConverter.php index 3d8ddc2ac2..24f9d67ed9 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchemaConverter.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchemaConverter.php @@ -320,7 +320,7 @@ protected function copyData(array &$sandbox) { } // Re-throw the original exception with a helpful message. - throw new EntityStorageException("The entity update process failed while processing the entity {$original_entity_type->id()}:$entity_id." . $e, $e->getCode(), $e); + throw new EntityStorageException("The entity update process failed while processing the entity {$original_entity_type->id()}:$entity_id.", $e->getCode(), $e); } $sandbox['progress']++;