Produces Fatal Error in Drupal 11

Created on 13 August 2025, 9 days ago

Problem/Motivation

I have a site where I use this module to show the user role(s) on the user profile page.
I updated the site to Drupal 11.

When users went to their profile page the result was a WSOD page.
I removed the User Role from the user profile display and the problem went away.

This is the error from the log:

Error: Call to undefined function user_role_names() in displayrole_user_view() (line 44 of /home/customer/public_html/modules/contrib/displayrole/displayrole.module).

I found this related issue.
[Drupal 11] user_role_names() deprecated in 10.2 and removed in 11.0
https://www.drupal.org/project/linkit/issues/3412457 πŸ“Œ [Drupal 11] user_role_names() deprecated in 10.2 and removed in 11.0 Fixed

From the issue text:
"Problem/Motivation
user_role_names() has been deprecated in Drupal 10.2.0 and will be removed in Drupal 11. See user_roles() and user_role_names() are deprecated β†’ for more details."

Looks like this module is dead in Drupal 11.

πŸ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada dadderley Vancouver

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

Comments & Activities

Production build 0.71.5 2024