diff --git a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php index ebd4e03..5b71b93 100644 --- a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php +++ b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php @@ -126,6 +126,9 @@ public function testNormalize() { 'default_langcode' => [ ['value' => TRUE], ], + 'revision_translation_affected' => [ + ['value' => TRUE], + ], 'non_rev_field' => [], 'field_test_text' => [ [ @@ -197,6 +200,7 @@ public function testSerialize() { 'user_id' => '' . $this->user->id() . '' . $this->user->getEntityTypeId() . '' . $this->user->uuid() . '' . $this->user->url() . '', 'revision_id' => '' . $this->entity->getRevisionId() . '', 'default_langcode' => '1', + 'revision_translation_affected' => '1', 'non_rev_field' => '', 'field_test_text' => '' . $this->values['field_test_text']['value'] . '' . $this->values['field_test_text']['format'] . '', ]; diff --git a/core/modules/system/system.install b/core/modules/system/system.install index c387be0..bf92ce5 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1992,6 +1992,10 @@ function system_update_8401() { function system_update_8402() { $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); + // Clear the cached entity type definitions so we get the new + // 'revision_translation_affected' entity key + \Drupal::entityTypeManager()->clearCachedDefinitions(); + // Get a list of revisionable and translatable entity types. /** @var \Drupal\Core\Entity\ContentEntityTypeInterface[] $definitions */ $definitions = array_filter(\Drupal::entityTypeManager()->getDefinitions(), function (EntityTypeInterface $entity_type) use ($definition_update_manager) { diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php index 4985470..d525514 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php @@ -542,6 +542,7 @@ protected function setUpEntityWithFieldDefinition($custom_invoke_all = FALSE, $f $this->entityType->getKeys()->willReturn($entity_keys + ['default_langcode' => 'default_langcode']); $this->entityType->entityClassImplements(FieldableEntityInterface::class)->willReturn(TRUE); $this->entityType->isTranslatable()->willReturn(FALSE); + $this->entityType->isRevisionable()->willReturn(FALSE); $this->entityType->getProvider()->willReturn('the_provider'); $this->entityType->id()->willReturn('the_entity_id'); @@ -651,6 +652,7 @@ public function testGetFieldMap() { $entity_type->getKeys()->willReturn(['default_langcode' => 'default_langcode']); $entity_type->entityClassImplements(FieldableEntityInterface::class)->willReturn(TRUE); $entity_type->isTranslatable()->shouldBeCalled(); + $entity_type->isRevisionable()->shouldBeCalled(); $entity_type->getProvider()->shouldBeCalled(); $non_content_entity_type->entityClassImplements(FieldableEntityInterface::class)->willReturn(FALSE); @@ -752,6 +754,7 @@ public function testGetFieldMapByFieldType() { $entity_type->getKeys()->willReturn(['default_langcode' => 'default_langcode'])->shouldBeCalled(); $entity_type->entityClassImplements(FieldableEntityInterface::class)->willReturn(TRUE)->shouldBeCalled(); $entity_type->isTranslatable()->shouldBeCalled(); + $entity_type->isRevisionable()->shouldBeCalled(); $entity_type->getProvider()->shouldBeCalled(); $override_entity_type->entityClassImplements(FieldableEntityInterface::class)->willReturn(FALSE)->shouldBeCalled(); diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php index d1045f5..431831c 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php @@ -58,7 +58,11 @@ public function testSet($key, $value) { */ public function testGetKeys($entity_keys, $expected) { $entity_type = $this->setUpEntityType(['entity_keys' => $entity_keys]); - $this->assertSame($expected + ['default_langcode' => 'default_langcode'], $entity_type->getKeys()); + $expected += [ + 'default_langcode' => 'default_langcode', + 'revision_translation_affected' => 'revision_translation_affected', + ]; + $this->assertSame($expected, $entity_type->getKeys()); } /**