user_role_names() deprecated in 10.2 and removed in 11.0

Created on 5 January 2024, 6 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 →

At line 327 in GoogleAnalyticsAdminSettingsForm.php the deprecated function is called. See below,

https://git.drupalcode.org/project/google_analytics/-/blob/4.x/src/Form/...

Steps to reproduce

  1. Enable this module in Drupal 10.2.0 installation.
  2. Go the setting form.
  3. An php warning message occured in the log said user_role_names() function is deprecated.

Proposed resolution

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

📌 Task
Status

Needs review

Version

4.0

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.69.0 2024