diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php index 92eb9ab..dc5f5d4 100644 --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php @@ -2,6 +2,7 @@ namespace Drupal\Core\Database\Driver\sqlite; +use Drupal\Component\Uuid\UuidInterface; use Drupal\Core\Database\Database; use Drupal\Core\Database\DatabaseNotFoundException; use Drupal\Core\Database\Connection as DatabaseConnection; @@ -336,7 +337,8 @@ public static function sqlFunctionLikeBinary($pattern, $subject) { * A UUID string. */ public static function sqlFunctionUUID() { - $generator = new \Drupal\Component\Uuid\Php(); + /** @var UuidInterface $generator */ + $generator = \Drupal::service('uuid'); return $generator->generate(); } diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index fffd1df..444684c 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -17,7 +17,7 @@ * * @ingroup entity_api */ -abstract class ContentEntityBase extends Entity implements \IteratorAggregate, ContentEntityInterface, TranslationStatusInterface { +abstract class ContentEntityBase extends Entity implements \IteratorAggregate, ContentEntityInterface, TranslationStatusInterface, RevisionUuidInterface { /** * The plain data values of the contained fields. @@ -1188,6 +1188,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { if ($entity_type->hasKey('revision_uuid')) { $fields[$entity_type->getKey('revision_uuid')] = BaseFieldDefinition::create('uuid') ->setLabel(new TranslatableMarkup('Revision UUID')) + ->setRevisionable(TRUE) ->setReadOnly(TRUE); } if ($entity_type->hasKey('langcode')) { diff --git a/core/lib/Drupal/Core/Entity/EntityType.php b/core/lib/Drupal/Core/Entity/EntityType.php index 2b41636..384dbb4 100644 --- a/core/lib/Drupal/Core/Entity/EntityType.php +++ b/core/lib/Drupal/Core/Entity/EntityType.php @@ -294,12 +294,6 @@ public function __construct($definition) { 'default_langcode' => 'default_langcode', ); - // If the entity type is revisionable, provide a default value for the - // 'revision_uuid' key. - if (!empty($this->entity_keys['revision']) && empty($this->entity_keys['revision_uuid'])) { - $this->entity_keys['revision_uuid'] = 'revision_uuid'; - } - $this->handlers += array( 'access' => 'Drupal\Core\Entity\EntityAccessControlHandler', );