user_role_names() deprecated in 10.2 and removed in 11.0

Created on 5 January 2024, 11 months ago
Updated 21 April 2024, 7 months ago

Problem/Motivation

Drupal user_role_names() function is deprecated in Drupal 10.2.0 and will be removed in Drupal 11.

See the change log for more details.
https://www.drupal.org/node/3349759

The deprecated function is called in the following places.

Steps to reproduce

  1. Enable this module in a Drupal 10.2.0 installation.
  2. Create a Webform.
  3. Config the email handler for this Webform.
  4. Or use token for this Webform.
  5. An PHP warning message occured in the logs said 'the user_role_names() deprecated in 10.2 and removed in 11.0'.

Proposed resolution

Replaced with array_map() withing result of Role::loadMultiple().

📌 Task
Status

Fixed

Version

6.2

Component

Code

Created by

🇦🇺Australia mingsong 🇦🇺

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024