user_role_names() deprecated in 10.2 and removed in 11.0

Created on 5 January 2024, 6 months ago
Updated 17 February 2024, 4 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 38 in RenderedItemProperty.php the deprecated function is called. See below,

https://git.drupalcode.org/project/search_api/-/blob/8.x-1.x/src/Plugin/...

Steps to reproduce

  1. Enable this module in a Drupal 10.2.0 installation.
  2. Config search api.
  3. Index search.
  4. Go to the search page.
  5. 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

Fixed

Version

1.0

Component

General code

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia Mingsong ๐Ÿ‡ฆ๐Ÿ‡บ

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

Comments & Activities

Production build 0.69.0 2024