summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2018-02-19 12:11:24 (GMT)
committerNathaniel Catchpole2018-02-19 12:11:33 (GMT)
commitab140c21005bbd664e00f0c89743cda76af37a33 (patch)
treecc597db0324bddfc5ec83f84e1480f816553d244
parent84e302e00c080033dadd25a15d13506346065293 (diff)
Issue #2937850 by Wim Leers, plach: Mark revision_default as internal for REST consumers
(cherry picked from commit 7eaf9abc729ea837ec20e20380553955adf9afc4)
-rw-r--r--core/lib/Drupal/Core/Entity/EntityFieldManager.php1
-rw-r--r--core/modules/hal/tests/src/Kernel/EntityTranslationNormalizeTest.php2
-rw-r--r--core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentResourceTestBase.php5
-rw-r--r--core/modules/rest/tests/src/Functional/EntityResource/Media/MediaResourceTestBase.php5
-rw-r--r--core/modules/rest/tests/src/Functional/EntityResource/Node/NodeResourceTestBase.php5
-rw-r--r--core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php4
6 files changed, 3 insertions, 19 deletions
diff --git a/core/lib/Drupal/Core/Entity/EntityFieldManager.php b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
index 025d92c..f847cfa 100644
--- a/core/lib/Drupal/Core/Entity/EntityFieldManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
@@ -231,6 +231,7 @@ class EntityFieldManager implements EntityFieldManagerInterface {
->setLabel($this->t('Default revision'))
->setDescription($this->t('A flag indicating whether this was a default revision when it was saved.'))
->setStorageRequired(TRUE)
+ ->setInternal(TRUE)
->setTranslatable(FALSE)
->setRevisionable(TRUE);
}
diff --git a/core/modules/hal/tests/src/Kernel/EntityTranslationNormalizeTest.php b/core/modules/hal/tests/src/Kernel/EntityTranslationNormalizeTest.php
index 2597af4..3e27ef6 100644
--- a/core/modules/hal/tests/src/Kernel/EntityTranslationNormalizeTest.php
+++ b/core/modules/hal/tests/src/Kernel/EntityTranslationNormalizeTest.php
@@ -83,6 +83,8 @@ class EntityTranslationNormalizeTest extends NormalizerTestBase {
$this->assertSame($node->getTitle(), $denormalized_node->getTitle());
$this->assertSame($translation->getTitle(), $denormalized_node->getTranslation('de')->getTitle());
+ $original_values['revision_default'] = [];
+ $original_translation_values['revision_default'] = [];
$this->assertEquals($original_values, $denormalized_node->toArray(), 'Node values are restored after normalizing and denormalizing.');
$this->assertEquals($original_translation_values, $denormalized_node->getTranslation('en')->toArray(), 'Node values are restored after normalizing and denormalizing.');
}
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentResourceTestBase.php
index f5b3fdc..5766817 100644
--- a/core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentResourceTestBase.php
+++ b/core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentResourceTestBase.php
@@ -122,11 +122,6 @@ abstract class BlockContentResourceTestBase extends EntityResourceTestBase {
'value' => TRUE,
],
],
- 'revision_default' => [
- [
- 'value' => TRUE,
- ],
- ],
'default_langcode' => [
[
'value' => TRUE,
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/Media/MediaResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/Media/MediaResourceTestBase.php
index 414b3eb..40f7997 100644
--- a/core/modules/rest/tests/src/Functional/EntityResource/Media/MediaResourceTestBase.php
+++ b/core/modules/rest/tests/src/Functional/EntityResource/Media/MediaResourceTestBase.php
@@ -212,11 +212,6 @@ abstract class MediaResourceTestBase extends EntityResourceTestBase {
'value' => TRUE,
],
],
- 'revision_default' => [
- [
- 'value' => TRUE,
- ],
- ],
];
}
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/Node/NodeResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/Node/NodeResourceTestBase.php
index fc827ac..bf0ba7a 100644
--- a/core/modules/rest/tests/src/Functional/EntityResource/Node/NodeResourceTestBase.php
+++ b/core/modules/rest/tests/src/Functional/EntityResource/Node/NodeResourceTestBase.php
@@ -152,11 +152,6 @@ abstract class NodeResourceTestBase extends EntityResourceTestBase {
'value' => TRUE,
],
],
- 'revision_default' => [
- [
- 'value' => TRUE,
- ],
- ],
'default_langcode' => [
[
'value' => TRUE,
diff --git a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php
index 65c82eb..72da3cb 100644
--- a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php
+++ b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php
@@ -150,9 +150,6 @@ class EntitySerializationTest extends NormalizerTestBase {
'default_langcode' => [
['value' => TRUE],
],
- 'revision_default' => [
- ['value' => TRUE],
- ],
'revision_translation_affected' => [
['value' => TRUE],
],
@@ -229,7 +226,6 @@ class EntitySerializationTest extends NormalizerTestBase {
'user_id' => '<user_id><target_id>' . $this->user->id() . '</target_id><target_type>' . $this->user->getEntityTypeId() . '</target_type><target_uuid>' . $this->user->uuid() . '</target_uuid><url>' . $this->user->url() . '</url></user_id>',
'revision_id' => '<revision_id><value>' . $this->entity->getRevisionId() . '</value></revision_id>',
'default_langcode' => '<default_langcode><value>1</value></default_langcode>',
- 'revision_default' => '<revision_default><value>1</value></revision_default>',
'revision_translation_affected' => '<revision_translation_affected><value>1</value></revision_translation_affected>',
'non_mul_field' => '<non_mul_field/>',
'non_rev_field' => '<non_rev_field/>',