When any role mapping field is empty, a deprecated function error is triggered upon a sign on attempt.

Created on 17 January 2023, over 1 year ago

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.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024