Problem/Motivation

When deleting a user role in Drupal 10.1.8, the associated views are also automatically deleted, even if the view has multiple roles assigned to it. This is unexpected behavior, as the correct behavior should be to only remove the deleted role from the view, while preserving the rest of the view's configuration.

Steps to reproduce

  1. Create a view in Drupal 10.1.8 and assign multiple roles to it.
  2. Delete one of the roles assigned to the view.
  3. Observe that the entire view is deleted, instead of just the deleted role being removed from the view.

Proposed resolution

The proposed resolution is to fix the behavior so that when a role is deleted, only that role is removed from the associated views, while preserving the rest of the view's configuration.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
IrpUOkAzrK.png103.91 KBcamilo 1990

Comments

camilo 1990 created an issue. See original summary.

cilefen’s picture

Title: Drupal Role Deletion Bug Views » When deleting a role, automatically update the configurations of views that reference the role, instead of deleting the views
Version: 10.1.x-dev » 11.x-dev
Category: Bug report » Feature request
Priority: Critical » Normal

This is not a bug because the delete form properly warns the administrator what will happen. We added that in #2468045: When deleting a content type field, users do not realize the related View also is deleted. In the past Drupal did not warn you!

This could be a feature request, but in that case it may not actually be safe to adjust the permissions of views because that could make the views available to others, etc. It would have to be done carefully.

Finally, be sure to test on a supported release. 10.1.x is unsupported.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.