Problem/Motivation

This module removes a resource from the plugin definitions when the reason for it is gone: the optional module it declares is not installed, the convention role it needs is empty, the bundle it serves was deleted. A site that had enabled that resource keeps its rest_resource_config entity, and the router was already made safe for that: the configuration is loaded disabled, the cache rebuild goes through and the endpoint answers 404.

The permission list was not. RestPermissions::permissions() asks every resource configuration for its plugin - enabled or not - with no guard, so a single configuration naming a missing plugin throws PluginNotFoundException out of user.permissions. Measured on a site: the permissions page cannot be built, and saving any role at all fails, because a role calculates its dependencies from the permission list. Nothing on the page says which configuration is to blame.

Proposed resolution

  • Make the permission list survive a configuration whose plugin is gone, in one place, for every case this module drops a definition in - the same promise the router already has.
  • Say which configuration names a missing plugin where a site owner looks: the status report, with the command that removes it.
  • Coverage: a configuration naming a missing plugin, and the permission list builds, a role can be saved and the permissions page renders.

Remaining tasks

Everything.

Issue fork myrest-3625519

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sergeydruua created an issue. See original summary.

  • sergeydruua committed 8606f17a on 1.0.x
    Issue #3625519: Keep roles saveable when a resource definition was...
sergeydruua’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergeydruua’s picture

Status: Fixed » Closed (fixed)