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

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.

Comments

dadderley created an issue. See original summary.

mlncn’s picture

Version: 8.x-1.2 » 8.x-1.x-dev
Assigned: Unassigned » mlncn
Priority: Normal » Critical
Status: Active » Needs work

Thank you for the report, so sorry for releasing a Drupal 11 version that was not actually compatible.

Gentle reminder that rather than proclaiming a module "dead" this is a golden opportunity to contribute a fix. Although, on second thought, that is thousands of words making clear how complicated it is to contribute what should be the simplest of things. Ah well. Fix coming shortly.

  • mlncn committed d00b4c4d on 8.x-1.x
    Add internal function to conveniently replace removed-in-D11 function...
mlncn’s picture

Status: Needs work » Needs review

  • mlncn committed 28a2659d on 8.x-1.x
    Add essential use statement for Role class
    
    [#3541241] feat: Produces...
mlncn’s picture

Status: Needs review » Fixed

Tested, fixed follow-up error, and tagged a release, 8.x-1.3.

dadderley’s picture

@mlncn

I apologize for being over dramatic saying that the module was dead.

I installed the fixed 8.x-1.3 version of the module and it works perfectly.

Thank you very much for the quick fix.

mlncn’s picture

Thank you so much! It definitely was not healthy there for a minute and very much needed this report!

dadderley’s picture

cheers

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.