diff --git a/src/Entity/WorkflowManager.php b/src/Entity/WorkflowManager.php index f3c2bef6be4f319a8fa96b7b8713593d35de4a46..40cc623f1b2265190e335a2ad06f77b5d5d29673 100644 --- a/src/Entity/WorkflowManager.php +++ b/src/Entity/WorkflowManager.php @@ -13,6 +13,7 @@ use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\field\Entity\FieldConfig; +use Drupal\user\Entity\Role; /** * Manages entity type plugin definitions. @@ -358,7 +359,9 @@ class WorkflowManager implements WorkflowManagerInterface { */ public static function participateUserRoles(EntityInterface $workflow) { $type_id = $workflow->id(); - foreach (user_roles() as $rid => $role) { + + $roles = Role::loadMultiple(); + foreach ($roles as $rid => $role) { $perms = ["create $type_id workflow_transition" => 1]; user_role_change_permissions($rid, $perms); // <=== Enable Roles. }