summaryrefslogtreecommitdiffstats
path: root/core/lib
diff options
context:
space:
mode:
Diffstat (limited to 'core/lib')
-rw-r--r--core/lib/Drupal/Core/Entity/ContentEntityBase.php15
-rw-r--r--core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php9
-rw-r--r--core/lib/Drupal/Core/Entity/ContentEntityType.php5
-rw-r--r--core/lib/Drupal/Core/Entity/EntityFieldManager.php14
-rw-r--r--core/lib/Drupal/Core/Entity/RevisionableInterface.php8
-rw-r--r--core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchemaConverter.php22
6 files changed, 0 insertions, 73 deletions
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
index 13c452c..00353e2 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
@@ -334,21 +334,6 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
/**
* {@inheritdoc}
*/
- public function wasDefaultRevision() {
- /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
- $entity_type = $this->getEntityType();
- if (!$entity_type->isRevisionable()) {
- return TRUE;
- }
-
- $revision_default_key = $entity_type->getRevisionMetadataKey('revision_default');
- $value = $this->isNew() || $this->get($revision_default_key)->value;
- return $value;
- }
-
- /**
- * {@inheritdoc}
- */
public function isLatestRevision() {
/** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */
$storage = $this->entityTypeManager()->getStorage($this->getEntityTypeId());
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
index c85c725..09ed82f 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
@@ -506,15 +506,6 @@ abstract class ContentEntityStorageBase extends EntityStorageBase implements Con
}
$this->populateAffectedRevisionTranslations($entity);
-
- // Populate the "revision_default" flag. We skip this when we are resaving
- // the revision because this is only allowed for default revisions, and
- // these cannot be made non-default.
- if ($this->entityType->isRevisionable() && $entity->isNewRevision()) {
- $revision_default_key = $this->entityType->getRevisionMetadataKey('revision_default');
- $entity->set($revision_default_key, $entity->isDefaultRevision());
- }
-
$this->doSaveFieldItems($entity);
return $return;
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityType.php b/core/lib/Drupal/Core/Entity/ContentEntityType.php
index 5be34c9..0e26c3b 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityType.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityType.php
@@ -19,15 +19,10 @@ class ContentEntityType extends EntityType implements ContentEntityTypeInterface
*/
public function __construct($definition) {
parent::__construct($definition);
-
$this->handlers += [
'storage' => 'Drupal\Core\Entity\Sql\SqlContentEntityStorage',
'view_builder' => 'Drupal\Core\Entity\EntityViewBuilder',
];
-
- $this->revision_metadata_keys += [
- 'revision_default' => 'revision_default',
- ];
}
/**
diff --git a/core/lib/Drupal/Core/Entity/EntityFieldManager.php b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
index c199564..63c35e9 100644
--- a/core/lib/Drupal/Core/Entity/EntityFieldManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
@@ -190,10 +190,8 @@ class EntityFieldManager implements EntityFieldManagerInterface {
* flagged as translatable.
*/
protected function buildBaseFieldDefinitions($entity_type_id) {
- /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
$entity_type = $this->entityTypeManager->getDefinition($entity_type_id);
$class = $entity_type->getClass();
- /** @var string[] $keys */
$keys = array_filter($entity_type->getKeys());
// Fail with an exception for non-fieldable entity types.
@@ -223,18 +221,6 @@ class EntityFieldManager implements EntityFieldManagerInterface {
}
// Make sure that revisionable entity types are correctly defined.
- if ($entity_type->isRevisionable()) {
- $field_name = $entity_type->getRevisionMetadataKey('revision_default');
- $base_field_definitions[$field_name] = BaseFieldDefinition::create('boolean')
- ->setLabel($this->t('Default revision'))
- ->setDescription($this->t('A flag indicating whether this was a default revision when it was saved.'))
- ->setStorageRequired(TRUE)
- ->setTranslatable(FALSE)
- ->setRevisionable(TRUE);
- }
-
- // Make sure that revisionable and translatable entity types are correctly
- // defined.
if ($entity_type->isRevisionable() && $entity_type->isTranslatable()) {
// The 'revision_translation_affected' field should always be defined.
// This field has been added unconditionally in Drupal 8.4.0 and it is
diff --git a/core/lib/Drupal/Core/Entity/RevisionableInterface.php b/core/lib/Drupal/Core/Entity/RevisionableInterface.php
index 0fc6db2..e25bc25 100644
--- a/core/lib/Drupal/Core/Entity/RevisionableInterface.php
+++ b/core/lib/Drupal/Core/Entity/RevisionableInterface.php
@@ -52,14 +52,6 @@ interface RevisionableInterface {
public function isDefaultRevision($new_value = NULL);
/**
- * 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.
- */
- public function wasDefaultRevision();
-
- /**
* Checks if this entity is the latest revision.
*
* @return bool
diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchemaConverter.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchemaConverter.php
index 2d3edfc..60712ee 100644
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchemaConverter.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchemaConverter.php
@@ -245,7 +245,6 @@ class SqlContentEntityStorageSchemaConverter {
$original_base_table = $original_entity_type->getBaseTable();
$revision_id_key = $temporary_entity_type->getKey('revision');
- $revision_default_key = $temporary_entity_type->getRevisionMetadataKey('revision_default');
$revision_translation_affected_key = $temporary_entity_type->getKey('revision_translation_affected');
// If 'progress' is not set, then this will be the first run of the batch.
@@ -289,10 +288,6 @@ class SqlContentEntityStorageSchemaConverter {
// Set the revision ID to be same as the entity ID.
$entity->set($revision_id_key, $entity_id);
- // We had no revisions so far, so the existing data belongs to the
- // default revision now.
- $entity->set($revision_default_key, TRUE);
-
// Set the 'revision_translation_affected' flag to TRUE to match the
// previous API return value: if the field was not defined the value
// returned was always TRUE.
@@ -385,23 +380,6 @@ class SqlContentEntityStorageSchemaConverter {
}
$updated_storage_definitions[$entity_type->getKey('revision')] = $revision_field;
- // Add the default revision flag field.
- $field_name = $entity_type->getRevisionMetadataKey('revision_default');
- $storage_definition = BaseFieldDefinition::create('boolean')
- ->setName($field_name)
- ->setTargetEntityTypeId($entity_type->id())
- ->setTargetBundle(NULL)
- ->setLabel(t('Default revision'))
- ->setDescription(t('A flag indicating whether this was a default revision when it was saved.'))
- ->setStorageRequired(TRUE)
- ->setTranslatable(FALSE)
- ->setRevisionable(TRUE);
-
- if ($update_cached_definitions) {
- $this->entityDefinitionUpdateManager->installFieldStorageDefinition($field_name, $entity_type->id(), $entity_type->getProvider(), $storage_definition);
- }
- $updated_storage_definitions[$field_name] = $storage_definition;
-
// Add the 'revision_translation_affected' field if needed.
if ($entity_type->isTranslatable()) {
$revision_translation_affected_field = BaseFieldDefinition::create('boolean')