RuntimeException: Adding non-existent permissions to a role is not allowed

Created on 7 February 2024, 11 months ago
Updated 4 March 2024, 10 months ago

Problem/Motivation

When deleting a workflow type, the permissions (for a user?) for this Workflow type are not removed, which is an error in D10.

This is as per the following D9.3 change-record: Permissions must exist

After a WSOD, the following error message is present in /admin/reports/dblog, on the following pages:
- when submitting Permissions: /admin/people/permissions.
- when adding a Workflow Type: /admin/config/workflow/workflow/add
- when deleting a Workflow Type: /admin/config/workflow/workflow/TYPE/delete:
Page /admin/reports/dblog will give the following error:

RuntimeException: Adding non-existent permissions to a role is not allowed. The incorrect permissions are "create TYPE workflow_transition". in Drupal\user\Entity\Role->calculateDependencies() (line 207 of ...\core\modules\user\src\Entity\Role.php).

Steps to reproduce

create a workflow type.
give permission 'Participate in workflow' to the user
remove the workflow type
go to permissions page, submit the page. Error appears.

Proposed resolution

When the error is encountered, install Workflow module 8.x-1.8 or 8.x-1.x-dev.
1. Create the named Workflow type again (only adding the first page of the creation process suffices).
2. You may encounter the same error for another Workflow type. Repeat step 1.
3. Now delete each obsolete Workflow type again.
4. If you were trying to create a new Workflow in the first place, you may need to remove and add that one. Alternatively, check the 'Participate in workflow' permissions for that Workflow type (the technical name above is misleading.) When creating a workflow type, this permission is automatically added to each role.

🐛 Bug report
Status

Fixed

Version

1.7

Component

Code

Created by

🇳🇱Netherlands johnv

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

Comments & Activities

Production build 0.71.5 2024