Problem/Motivation

The module uses role mapping to map Drupal user roles to Onelogin users based on their Onelogin roles. This is done by indicating in a text field for each Drupal role, the Onelogin role(s) that apply. If any of the Role mapping fields are left empty, then a deprecation error message is shown after signing in.

Error message:
Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupallonelogin_ integration AuthenticationService->syncRoles() (line 254 of modules/contrib/onelogin_integration/sc/AuthenticationService.php).

Steps to reproduce

  • Create multiple user roles in Drupal
  • Install and configure the onelogin_integration module to work with a Onelogin Application.
  • Fill in at least role mapping field, while leaving one or more empty.
  • Sign out and attempt to sign in as a onelogin user
  • Navigate to /admin/content and the error message should appear

Proposed resolution

Add a condition to the syncRoles() function so that empty role mapping fields are not processed.

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

esdrasterrero created an issue.

AshM made their first commit to this issue’s fork.

  • AshM committed e4327de0 on 8.x-2.x
    #3334119 : When any role mapping field is empty, a deprecated function...

  • AshM committed 154a3025 on 8.x-2.x
    #3334119 : When any role mapping field is empty, a deprecated function...