Problem/Motivation

The escape hatch for behaviour no structure can express — a subclass in the site's own module — depends on two classes sharing a plugin id and the handwritten one winning. Without that resolution, a site with a subclass gets whichever class the discovery happened to find last.

Proposed resolution

  • Implement hook_rest_resource_alter() so that a plugin whose class lives outside the generated directory takes precedence over the generated one with the same id.
  • Report the override on the status page — an overridden endpoint that nobody remembers overriding is a debugging trap.
  • Fail loudly when two handwritten classes claim the same id: that is a mistake, not a precedence question.
  • Functional test with a generated resource and a subclass that changes one key.

Remaining tasks

Everything.

Issue fork myrest-3621988

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 e928af8b on 1.0.x
    Issue #3621988: Let a subclass outside the generated directory win over...
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)