diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
index e7c235d76d..3effe8b3c2 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
@@ -331,23 +331,6 @@ public function isDefaultRevision($new_value = NULL) {
return $this->isNew() || $return;
}
- /**
- * {@inheritdoc}
- */
- public function wasDefaultRevision() {
- /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
- $entity_type = $this->getEntityType();
- if (!$entity_type->isRevisionable()) {
- throw new \LogicException("Entity type {$this->getEntityTypeId()} does not support revisions.");
- }
- $revision_default_key = $entity_type->getRevisionMetadataKey('revision_default');
- $value = $this->hasField($revision_default_key) ? $this->get($revision_default_key)->value : NULL;
- if (isset($value)) {
- return (bool) $value;
- }
- throw new \LogicException("Missing data for the \"{$revision_default_key}\" field on the entity {$this->getEntityTypeId()}:{$this->id()}.");
- }
-
/**
* {@inheritdoc}
*/
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityInterface.php b/core/lib/Drupal/Core/Entity/ContentEntityInterface.php
index e85a299312..3053d23694 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityInterface.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityInterface.php
@@ -106,16 +106,4 @@ public function getLoadedRevisionId();
*/
public function updateLoadedRevisionId();
- /**
- * Checks whether the entity object was a default revision when it was saved.
- *
- * @return bool
- * TRUE if the entity object was a revision, FALSE otherwise.
- *
- * @throws \LogicException
- * If the entity type is not revisionable or the default revision data is
- * missing.
- */
- public function wasDefaultRevision();
-
}
diff --git a/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php b/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php
index 57ddb167dd..a3bed11c1c 100644
--- a/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php
+++ b/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php
@@ -146,4 +146,21 @@ protected static function getRevisionMetadataKey(EntityTypeInterface $entity_typ
return $revision_metadata_keys[$key];
}
+ /**
+ * {@inheritdoc}
+ */
+ public function wasDefaultRevision() {
+ /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
+ $entity_type = $this->getEntityType();
+ if (!$entity_type->isRevisionable()) {
+ throw new \LogicException("Entity type {$this->getEntityTypeId()} does not support revisions.");
+ }
+ $revision_default_key = $entity_type->getRevisionMetadataKey('revision_default');
+ $value = $this->hasField($revision_default_key) ? $this->get($revision_default_key)->value : NULL;
+ if (isset($value)) {
+ return (bool) $value;
+ }
+ throw new \LogicException("Missing data for the \"{$revision_default_key}\" field on the entity {$this->getEntityTypeId()}:{$this->id()}.");
+ }
+
}
diff --git a/core/lib/Drupal/Core/Entity/RevisionLogInterface.php b/core/lib/Drupal/Core/Entity/RevisionLogInterface.php
index becf97c162..806c300072 100644
--- a/core/lib/Drupal/Core/Entity/RevisionLogInterface.php
+++ b/core/lib/Drupal/Core/Entity/RevisionLogInterface.php
@@ -81,4 +81,16 @@ public function getRevisionLogMessage();
*/
public function setRevisionLogMessage($revision_log_message);
+ /**
+ * Checks whether the entity object was a default revision when it was saved.
+ *
+ * @return bool
+ * TRUE if the entity object was a revision, FALSE otherwise.
+ *
+ * @throws \LogicException
+ * If the entity type is not revisionable or the default revision data is
+ * missing.
+ */
+ public function wasDefaultRevision();
+
}
diff --git a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php
index f389336621..5b71b93b7a 100644
--- a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php
+++ b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php
@@ -129,9 +129,6 @@ public function testNormalize() {
'revision_translation_affected' => [
['value' => TRUE],
],
- 'revision_default' => [
- ['value' => TRUE],
- ],
'non_rev_field' => [],
'field_test_text' => [
[
@@ -204,7 +201,6 @@ public function testSerialize() {
'revision_id' => '' . $this->entity->getRevisionId() . '',
'default_langcode' => '1',
'revision_translation_affected' => '1',
- 'revision_default' => '1',
'non_rev_field' => '',
'field_test_text' => '' . $this->values['field_test_text']['value'] . '' . $this->values['field_test_text']['format'] . '',
];
diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
index c73b6e59df..59bb84eea1 100644
--- a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
+++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
@@ -57,6 +57,7 @@ public static function getSkippedDeprecations() {
'The revision_user revision metadata key is not set.',
'The revision_created revision metadata key is not set.',
'The revision_log_message revision metadata key is not set.',
+ 'The revision_default revision metadata key is not set.',
'The "entity.query" service relies on the deprecated "Drupal\Core\Entity\Query\QueryFactory" class. It should either be deprecated or its implementation upgraded.',
'MigrateCckField is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. Use \Drupal\migrate_drupal\Annotation\MigrateField instead.',
'MigrateCckFieldPluginManager is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. Use \Drupal\migrate_drupal\Annotation\MigrateFieldPluginManager instead.',