diff -u b/core/modules/system/system.install b/core/modules/system/system.install --- b/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1751,9 +1751,25 @@ $database_schema = $database->schema(); foreach (\Drupal::entityTypeManager()->getDefinitions() as $entity_type_id => $entity_type) { - if ($entity_type instanceOf \Drupal\Core\Entity\ContentEntityTypeRevisionMetadataInterface && $entity_type->isRevisionable()) { + if (is_subclass_of($entity_type->getClass(), \Drupal\Core\Entity\FieldableEntityInterface::class) && $entity_type->isRevisionable()) { $base_fields = $base_fields = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions($entity_type_id); - $fields_to_update = array_intersect_key($base_fields, $entity_type->getRevisionMetadataKeys()); + if ($entity_type instanceof \Drupal\Core\Entity\ContentEntityTypeRevisionMetadataInterface) { + $revision_metadata_fields = $entity_type->getRevisionMetadataKeys(); + } + else { + // For backward comparability reasons we need to mention explicitly the + // revision metadata fields in case the entity type does not implement + // the ContentEntityTypeRevisionMetadataInterface. + $revision_metadata_fields = [ + 'revision_timestamp', + 'revision_uid', + 'revision_log', + 'revision_created', + 'revision_user', + 'revision_log_message', + ]; + } + $fields_to_update = array_intersect_key($base_fields, array_flip($revision_metadata_fields)); if (!empty($fields_to_update)) { $base_table = $entity_type->getBaseTable() ?: $entity_type_id;