diff --git a/modules/acquia_cms_common/acquia_cms_common.install b/modules/acquia_cms_common/acquia_cms_common.install index 66dec023b0..4786231369 100644 --- a/modules/acquia_cms_common/acquia_cms_common.install +++ b/modules/acquia_cms_common/acquia_cms_common.install @@ -304,3 +304,17 @@ function acquia_cms_common_update_8009() { } } } + +/** + * Implements hook_update_N(). + * + * Set disabled FALSE to jsonapi resource for user to API menu. + */ +function acquia_cms_common_update_8010() { + if (\Drupal::moduleHandler()->moduleExists('acquia_cms_headless_ui') && + ($jsonapi_config = \Drupal::configFactory()->getEditable('jsonapi_extras.jsonapi_resource_config.user--user'))) { + if ($jsonapi_config->get('disabled')) { + $jsonapi_config->set('disabled', FALSE)->save(TRUE); + } + } +} diff --git a/modules/acquia_cms_common/config/optional/jsonapi_extras.jsonapi_resource_config.user--user.yml b/modules/acquia_cms_common/config/optional/jsonapi_extras.jsonapi_resource_config.user--user.yml index 1646fc7732..3b8765518b 100644 --- a/modules/acquia_cms_common/config/optional/jsonapi_extras.jsonapi_resource_config.user--user.yml +++ b/modules/acquia_cms_common/config/optional/jsonapi_extras.jsonapi_resource_config.user--user.yml @@ -4,7 +4,7 @@ dependencies: module: - user id: user--user -disabled: true +disabled: false path: user/user resourceType: user--user resourceFields: @@ -134,3 +134,9 @@ resourceFields: publicName: field_password_expiration enhancer: id: '' + field_pending_expire_sent: + disabled: false + fieldName: field_pending_expire_sent + publicName: field_pending_expire_sent + enhancer: + id: '' diff --git a/tests/src/ExistingSite/DecoupledTest.php b/tests/src/ExistingSite/DecoupledTest.php index db1e2a376f..b408052f39 100644 --- a/tests/src/ExistingSite/DecoupledTest.php +++ b/tests/src/ExistingSite/DecoupledTest.php @@ -133,7 +133,7 @@ public function testResourceTypes(?array $roles) { // The user resource type should be disabled, so we should not be able to // do anything with it. - $this->assertResourceType(FALSE, $this->createUser(), [ + $this->assertResourceType(TRUE, $this->createUser(), [ 'PATCH' => [ 'display_name' => 'Superman', ],