Undefined function 'user_role_names' in Drupal 11

Created on 19 June 2025, 8 days ago

Problem/Motivation

The user_role_names function was removed in Drupal 11, see: https://www.drupal.org/project/drupal/issues/3432868 πŸ“Œ Remove deprecated code from user module Fixed and https://www.drupal.org/node/3349759 β†’ .

The function is still used in both views filters:

https://git.drupalcode.org/project/views_published_or_roles/-/blob/8.x-1...

https://git.drupalcode.org/project/views_published_or_roles/-/blob/8.x-1...

We need to replace it, otherwise the modules it not fully compatible with D11.

Steps to reproduce

Proposed resolution

Replace it with Role::loadMultiple()

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia poker10

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

Comments & Activities

Production build 0.71.5 2024