core/modules/rest/config/schema/rest.schema.yml | 5 +++++ core/modules/rest/rest.install | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/core/modules/rest/config/schema/rest.schema.yml b/core/modules/rest/config/schema/rest.schema.yml index 467ae5b..7c9e650 100644 --- a/core/modules/rest/config/schema/rest.schema.yml +++ b/core/modules/rest/config/schema/rest.schema.yml @@ -1,3 +1,8 @@ +# Make non-REST update path tests pass. +# @todo Remove this when those update path tests from 8.0.0 to the last 8.x minor before 9.0.0 have been removed. +rest.settings: + type: config_object + # Method-level granularity of REST resource configuration. rest_resource.method: type: mapping diff --git a/core/modules/rest/rest.install b/core/modules/rest/rest.install index c2d9412..69384b0 100644 --- a/core/modules/rest/rest.install +++ b/core/modules/rest/rest.install @@ -24,3 +24,28 @@ function rest_requirements($phase) { } return $requirements; } + +/** + * Make non-REST update path tests pass. + * + * @todo Remove this when those update path tests from 8.0.0 to the last 8.x minor before 9.0.0 have been removed. + */ +function rest_update_8201() { + \Drupal::entityDefinitionUpdateManager()->installEntityType(new ConfigEntityType([ + 'id' => 'rest_resource_config', + 'label' => new TranslatableMarkup('REST resource configuration'), + 'config_prefix' => 'resource', + 'admin_permission' => 'administer rest resources', + 'label_callback' => 'getLabelFromPlugin', + 'entity_keys' => ['id' => 'id'], + 'config_export' => [ + 'id', + 'plugin_id', + 'granularity', + 'configuration', + ], + ])); + \Drupal::configFactory()->getEditable('rest.settings') + ->clear('resources') + ->save(); +}