- Issue created by @justcaldwell
- πΊπΈUnited States justcaldwell Austin, Texas
Minor IS edit, and I didn't mean to set to Major.
- π¬π§United Kingdom thatlotnextdoor
Getting the similar Failed: RuntimeException: Adding non-existent permissions to a role is not allowed. The incorrect permissions are "use menu link attributes", "administer menu link attributes". in Drupal\user\Entity\Role->calculateDependencies() (line 207 of [redacted]/web/core/modules/user/src/Entity/Role.php).
Appeared after updating Drupal 10.0.4 to 10.2.0.
Grateful for any assistance!!
- π³π±Netherlands ricardopeters
A workaroud that worked for us, was going to the yaml of the specific role, remove the `administer * menu items` entry and do a config import.
- πΊπΈUnited States justcaldwell Austin, Texas
Just bumped into this again. Updated Steps to Reproduce to more reliably invoke the error.
- Merge request !20Add menu config dependency to dynamic permission entries β (Open) created by justcaldwell
- πΊπΈUnited States justcaldwell Austin, Texas
MR 20 adds the required dependencies. Ideally, we'd also provide an update hook to clean up any stale invalid permissions hanging around (hence the draft MR). I'll try to take a pass that hook soonish, if no one beats me to it ;).
- πΊπΈUnited States justcaldwell Austin, Texas
The update hook from a patch for the same issue in entityqueue β looks almost cut-and-paste-able.
- πΊπΈUnited States justcaldwell Austin, Texas
Post update hook added. Ready for review/testing.
- πΊπΈUnited States justcaldwell Austin, Texas
Posting a static patch. Also bumping to Major as this can render the Permissions page unusable unless/until you do something like the suggested workaround in #5.
- πΊπΈUnited States justcaldwell Austin, Texas
Hmm. Looks like the update hook should also cause an update of any role with any menu_admin_per_menu permission, so the dependencies for existing permissions are applied. Back to NW. :\
- πΊπΈUnited States justcaldwell Austin, Texas
Updated the MR with a second post-update hook to run after invalid permissions are removed. So the solution now:
- Implements logic to associate appropriate menu config dependencies with Menu Admin per Menu permissions.
- Removes any stale/invalid Menu Admin per Menu permissions (i.e. for menus that have been deleted).
- Re-calculates dependencies and updates roles that have existing Menu Admin per Menu permissions (in light of #1).
Back to NR.
- πΊπΈUnited States justcaldwell Austin, Texas
Updated static patch attached.