View permissions for deleted node type

Created on 28 August 2023, over 1 year ago
Updated 12 October 2023, over 1 year ago

Problem/Motivation

When changing any permission after deleting a content type using the form in the admin panel, Drupal returns a message stating an unexpected error occurred.
The log message is this:

Message RuntimeException: Adding non-existent permissions to a role is not allowed. The incorrect permissions are "view any DELETED_TYPE_1 content", "view any DELETED_TYPE_2 content". in Drupal\user\Entity\Role->calculateDependencies() (line 207 of /var/www/drupal-prod/web/core/modules/user/src/Entity/Role.php).

DELETED_TYPE_x being the content types that were previously deleted. The view permission for those content types does not show up in the form, but it seems to be stopping the permissions being modified. The issue persists after cache and permissions rebuild.

Steps to reproduce

1. Delete a content type
2. Rebuild cache and permissions
3. Try to change any permission
4. Observe error

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.6

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024