Prevent locked roles from being selected as default

Created on 6 March 2024, 7 months ago
Updated 7 March 2024, 7 months ago

When configuring the module, if authenticated or anonymous are set as the default role, the module will throw an exception:

InvalidArgumentException: Anonymous or authenticated role ID must not be assigned manually. in Drupal\user\Entity\User->addRole() (line 205 of /vhosts/drupaladmin/devweapons.com/htdocs/web/core/modules/user/src/Entity/User.php).

1. Remove those roles from the default role dropdown.
2. Add ajax or states to populate the default role dropdown with selected roles checked above it.

This applies to Drupal 7 + 8+.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada slydevil Halifax

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

Comments & Activities

Production build 0.71.5 2024