Problem/Motivation
After updating to 6.0.x from 5.0.x, noticed that the #3511288: Add Wildcard Support (*|role_name) for Default Role Assignment in o365 Role Mapping issue introduced some unintentional breaking changes between the updates, first being:
TypeError: Cannot assign null to property Drupal\o365\RolesService::$defaultRole of type string in Drupal\o365\RolesService->getConfiguredRoles() (line 209 of /var/www/html/application/web/modules/contrib/o365/src/RolesService.php).
And this is because the default role is NULL (we should probably try and move away from special values like _none entirely from the config, and favour an empty string instead.
The second being, that it enforces the user role mapping functionality on everyone, resulting in existing roles being removed from the user.
Proposed resolution
1. Ignore the user role mapping behaviour if there are no configured role mappings.
2. Introduce a config schema for the role settings.
3. Add a default config/install entry for the role settings.
4. Ideally add an update hook that sets the default config values for sites updating from 5.x (not strictly necessary)
Remaining tasks
Provide MR addressing issues.
User interface changes
N/A
API changes
N/A
Issue fork o365-3562450
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
codebymikey commentedComment #4
codebymikey commentedComment #5
fabianderijkThis looks good to me, merging the MR
Comment #6
fabianderijkThis is now added in the dev version. Will release a new tag today