config entity type 'config_prefix' is documented as required but in code is optional

Created on 16 November 2024, 6 months ago

Problem/Motivation

* - In the entity type annotation, you will need to define a 'config_prefix'
* string. When Drupal stores a configuration item, it will be given a name

* Configuration object names of configuration entities are comprised of two
* parts, separated by a dot:
* - config_prefix: A string denoting the owner (module/extension) of the
* configuration object, followed by arbitrary other namespace identifiers
* that are declared by the owning extension; e.g., 'node.type'. The
* config_prefix does NOT contain a trailing dot. It is defined by the entity
* type's annotation.

but in code:

  public function getConfigPrefix() {
    // Ensure that all configuration entities are prefixed by the name of the
    // module that provides the configuration entity type.
    if (isset($this->config_prefix)) {
      $config_prefix = $this->provider . '.' . $this->config_prefix;
    }
    else {
      $config_prefix = $this->provider . '.' . $this->id();
    }

Steps to reproduce

Proposed resolution

I don't know which is wrong!

So either:

- change the docs to say it's optional
- change the code to make it required

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

entity system

Created by

πŸ‡¬πŸ‡§United Kingdom joachim

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024