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.

Line 73 in the UserMatcher.php file calls the deprecated function.

Steps to reproduce

  1. Enable this module in a Drupal 10.2.0 installation.
  2. Config Linkit plugin for a editor.
  3. An php warning message occured in the log said user_role_names() function is deprecated.

Proposed resolution

Replaced the function code with code that passes the value returned from Role::loadMultiple() to array_map() to build the option array for $form['role_restrictions']['roles'].

CommentFileSizeAuthor
#3 3412457-3.patch1.31 KBdineshkumarbollu

Issue fork linkit-3412457

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Mingsong created an issue. See original summary.

mingsong’s picture

Issue summary: View changes
dineshkumarbollu’s picture

StatusFileSize
new1.31 KB

Hi @Mingsong
Created patch please review and test.Thanks

apaderno made their first commit to this issue’s fork.

avpaderno’s picture

Issue summary: View changes
Status: Active » Needs review
mark_fullmer’s picture

Title: user_role_names() deprecated in 10.2 and removed in 11.0 » [Drupal 11] user_role_names() deprecated in 10.2 and removed in 11.0
Version: 6.1.x-dev » 7.x-dev

mark_fullmer’s picture

Status: Needs review » Fixed

Thanks, everyone, for contributing to the Drupal 11 compatibility for this module!

Status: Fixed » Closed (fixed)

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