Problem/Motivation

Content type identifiers such as article, news, doctor, discount, package, video, before_after and page are hardcoded throughout the helper and REST resources. This makes the endpoints unusable on sites with a different content model.

Proposed resolution

  • Add a bundle-mapping configuration object alongside the field mapping.
  • Let each resource plugin declare the bundle it serves through its plugin definition rather than inline literals.
  • Skip resource registration when the configured bundle does not exist on the site.

Remaining tasks

Introduce the mapping, refactor resources, and document the defaults in README.

User interface changes

New bundle-mapping section in the module settings.

API changes

Resource plugins resolve bundles from configuration.

Issue fork myrest-3615410

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 de890057 on 1.0.x
    Issue #3615410: Remove hardcoded bundle names from resources and helpers
    
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)