diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install index b4fd6aa..ab761b6 100644 --- a/core/modules/comment/comment.install +++ b/core/modules/comment/comment.install @@ -179,3 +179,25 @@ function comment_update_8200() { /** * @} End of "addtogroup updates-8.2.x". */ + +/** + * @addtogroup updates-8.3.x + * @{ + */ + +function comment_update_8300() { + $lastInstalledSchemaRepository = \Drupal::service('entity.last_installed_schema.repository'); + /** @var \Drupal\Core\Entity\EntityTypeInterface $last_entity_type */ + $last_entity_type = $lastInstalledSchemaRepository->getLastInstalledDefinition('comment'); + $keys = $last_entity_type->getKeys(); + $keys['status'] = 'status'; + $last_entity_type->set('entity_keys', $keys); + $lastInstalledSchemaRepository->setLastInstalledDefinition($last_entity_type); + + $field_definitions = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions('comment'); + \Drupal::service('entity.definition_update_manager')->updateFieldStorageDefinition($field_definitions['status']); +} + +/** + * @} End of "addtogroup updates-8.3.x". + */ diff --git a/core/modules/rest/src/Tests/UpdateTest.php b/core/modules/rest/src/Tests/UpdateTest.php index 3eef1a9..149c72c 100644 --- a/core/modules/rest/src/Tests/UpdateTest.php +++ b/core/modules/rest/src/Tests/UpdateTest.php @@ -318,7 +318,6 @@ public function testUpdateComment() { 'homepage', // Extra compared to HAL+JSON. 'created', 'changed', - 'status', 'thread', 'entity_type', 'field_name',