Skip to content
Snippets Groups Projects
Commit fabc088e authored by catch's avatar catch
Browse files

Issue #2803179 by Wim Leers, MKorostoff, Berdir, dawehner: [regression]...

Issue #2803179 by Wim Leers, MKorostoff, Berdir, dawehner: [regression] rest_update_8201() can fail and break things
parent 6a4cfa29
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
* Install, update and uninstall functions for the rest module. * Install, update and uninstall functions for the rest module.
*/ */
use Drupal\Core\Config\Entity\ConfigEntityType;
use Drupal\Core\StringTranslation\TranslatableMarkup;
/** /**
* Implements hook_requirements(). * Implements hook_requirements().
*/ */
...@@ -34,7 +37,20 @@ function rest_requirements($phase) { ...@@ -34,7 +37,20 @@ function rest_requirements($phase) {
* @see rest_post_update_create_rest_resource_config_entities() * @see rest_post_update_create_rest_resource_config_entities()
*/ */
function rest_update_8201() { function rest_update_8201() {
\Drupal::entityDefinitionUpdateManager()->installEntityType(\Drupal::entityTypeManager()->getDefinition('rest_resource_config')); \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::state()->set('rest_update_8201_resources', \Drupal::config('rest.settings')->get('resources')); \Drupal::state()->set('rest_update_8201_resources', \Drupal::config('rest.settings')->get('resources'));
\Drupal::configFactory()->getEditable('rest.settings') \Drupal::configFactory()->getEditable('rest.settings')
->clear('resources') ->clear('resources')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment