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

Command icon 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

codebymikey created an issue. See original summary.

codebymikey’s picture

Status: Active » Needs review
codebymikey’s picture

Title: Provide migration pathway from 5.x with Role mapping feature breaking sites running 6.x » Provide upgrade pathway from 5.x with Role mapping feature breaking sites running 6.x
fabianderijk’s picture

This looks good to me, merging the MR

fabianderijk’s picture

Status: Needs review » Fixed

This is now added in the dev version. Will release a new tag today

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.