diff --git a/core/modules/jsonapi/tests/src/Functional/RoleTest.php b/core/modules/jsonapi/tests/src/Functional/RoleTest.php index a8bd71e369..24446378d4 100644 --- a/core/modules/jsonapi/tests/src/Functional/RoleTest.php +++ b/core/modules/jsonapi/tests/src/Functional/RoleTest.php @@ -54,6 +54,7 @@ protected function createEntity() { $role = Role::create([ 'id' => 'llama', 'name' => $this->randomString(), + 'description' => '', ]); $role->save(); @@ -88,7 +89,7 @@ protected function getExpectedDocument() { 'langcode' => 'en', 'status' => TRUE, 'dependencies' => [], - 'description' => null, + 'description' => '', 'label' => NULL, 'is_admin' => NULL, 'permissions' => [], diff --git a/core/modules/user/src/RoleForm.php b/core/modules/user/src/RoleForm.php index 116b54daae..5fee9b00e5 100644 --- a/core/modules/user/src/RoleForm.php +++ b/core/modules/user/src/RoleForm.php @@ -11,12 +11,10 @@ * @internal */ class RoleForm extends EntityForm { - /** * {@inheritdoc} */ public function form(array $form, FormStateInterface $form_state) { - /** @var RoleInterface $entity */ $entity = $this->entity; @@ -64,7 +62,7 @@ public function save(array $form, FormStateInterface $form_state) { // Prevent leading and trailing spaces in role names. $entity->set('label', trim($entity->label())); - $entity->setDescription(trim($entity->getDescription())); + $entity->setDescription($entity->getDescription()); $status = $entity->save(); $edit_link = $this->entity->toLink($this->t('Edit'), 'edit-form')->toString(); diff --git a/core/profiles/demo_umami/config/install/user.role.author.yml b/core/profiles/demo_umami/config/install/user.role.author.yml index 271e19fbf5..a1a62ef853 100644 --- a/core/profiles/demo_umami/config/install/user.role.author.yml +++ b/core/profiles/demo_umami/config/install/user.role.author.yml @@ -40,4 +40,4 @@ permissions: - 'view page revisions' - 'view recipe revisions' - 'view the administration theme' -description: null +description: 'The role given to content authors.' diff --git a/core/profiles/demo_umami/config/install/user.role.editor.yml b/core/profiles/demo_umami/config/install/user.role.editor.yml index 9f3b542135..72c950f978 100644 --- a/core/profiles/demo_umami/config/install/user.role.editor.yml +++ b/core/profiles/demo_umami/config/install/user.role.editor.yml @@ -44,4 +44,4 @@ permissions: - 'view page revisions' - 'view recipe revisions' - 'view the administration theme' -description: null +description: 'The role given to content editors.' diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php index 6ae51e5d48..1dc6787969 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php @@ -107,11 +107,7 @@ public function testConfigSync() { 'create' => [], // The system.mail is changed configuration because the test system // changes it to ensure that mails are not sent. - 'update' => [ - 'system.mail', - 'user.role.anonymous', - 'user.role.authenticated', - ], + 'update' => ['system.mail'], 'delete' => [], 'rename' => [], ];