Administrator role does not clone properly

Created on 3 June 2024, 7 months ago

Problem/Motivation

Cloning the Administrator role creates a new role, however all permissions are selected yet disabled just like the configured Administrator role. This should not occur since there can only be one Administrator role on a site.

Additionally, this warning will be thrown upon cloning a role:
Warning: Undefined array key "status" in Drupal\entity_clone\Form\EntityCloneForm->submitForm() (line 338 of modules/contrib/entity_clone/src/Form/EntityCloneForm.php).

Steps to reproduce

  1. Go to /admin/people/roles
  2. Select the Clone operation for the default Administrator role (or whichever role is configured as the Administrator role)
  3. Enter any string as the role label and select Clone
  4. On the /admin/people/permissions page, the newly created role will have all permission checkboxes selected but disabled, just like the Administrator role.
  5. On the /admin/people/role-settings page, the Administrator Role details fieldset will expand/collapse, but the Administrator Role field is missing.
  6. Saving the Role settings configuration will work, and it will set as the administrator role the default "Administrator" role
  7. The Permissions page will now have no permission checkboxes selected for the newly created role.

Proposed resolution

Cloning the Administrator role should create a new role with all permissions selected, but they should not be disabled, like any other non-Administrator role. Additionally, re-saving the role settings configuration should not be required.

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States iankmcilwraith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024