Skip to content
Snippets Groups Projects
Commit a34e057f authored by João Rochate's avatar João Rochate Committed by John Voskuilen
Browse files

Issue #3424655 by jrochate: Participate in workflow doesn't filter after...

Issue #3424655 by jrochate: Participate in workflow doesn't filter after deprecating user_role_names
parent e5f05193
Branches
Tags
No related merge requests found
Pipeline #107728 passed with warnings
......@@ -319,7 +319,7 @@ function workflow_get_user_role_names($permission = NULL) {
// Copied from AccountForm::form().
if (version_compare(\Drupal::VERSION, '10.2', '>=')) {
$roles = Role::loadMultiple();
$roles = array_filter(Role::loadMultiple(), fn(RoleInterface $role) => $role->hasPermission($permission));
$roles = array_map(fn(RoleInterface $role) => Html::escape($role->label()), $roles);
}
else {
......@@ -328,9 +328,9 @@ function workflow_get_user_role_names($permission = NULL) {
}
$author_label = '(' . t(WORKFLOW_ROLE_AUTHOR_NAME) . ')';
$author_roles = [WORKFLOW_ROLE_AUTHOR_RID => Html::escape($author_label)];
$author_role = [WORKFLOW_ROLE_AUTHOR_RID => Html::escape($author_label)];
$role_names[$permission] = $author_roles + $roles;
$role_names[$permission] = $author_role + $roles;
return $role_names[$permission];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment