Deleting taxonomy vocabulary does not remove related permissions

Created on 13 December 2023, 6 months ago
Updated 14 December 2023, 6 months ago

Problem/Motivation

When deleting a vocabulary, the related permissions are still assigned to roles.

If you then try to add new permissions via drush, a RuntimeException is thrown from \Drupal\user\Entity\Role::calculateDependencies

Adding non-existent permissions to a role is not allowed.

Steps to reproduce

1. create a taxonomy vocabulary
2. assign related permissions for that vocabulary
3. delete the vocabulary
4. check the permissions for the role- e.g. drush role:list --filter='rid=superuser' | grep 'create terms' - the permissions relating to that vocabulary are still present
5. clear cache and run cron
6. check the permissions again - the related permissions are still there
7. assign other permissions via drush, e.g. drush role:perm:add superuser 'administer search_api' - this fails with the message "Adding non-existent permissions to a role is not allowed."

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Postponed: needs info

Version

10.1 ✨

Component
TaxonomyΒ  β†’

Last updated 1 day ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @xjm
  • πŸ‡¬πŸ‡§United Kingdom @catch
Created by

πŸ‡¬πŸ‡§United Kingdom malcomio

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

Comments & Activities

  • Issue created by @malcomio
  • Status changed to Postponed: needs info 6 months ago
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Tried to reproduce this on a clean Umami install but not problems there as far as I can tell

    Steps done:
    * Add a new Vocabulary
    * Add permissions for this Vocabulary to the Editor and Author roles
    * Check the config for these roles in config sync (/admin/config/development/configuration/single/export) and make sure the permissions are there
    * Delete the Vocabulary
    * Check the config for these roles in config sync (/admin/config/development/configuration/single/export) and make sure the permissions are gone

    Am I missing steps? Or does this only break when using Drush?

Production build 0.69.0 2024