Entity annotation includes "human_name" key that is never configured on entities

Created on 17 October 2022, about 2 years ago
Updated 19 August 2024, 3 months ago

Problem/Motivation

src/Entity/EnvironmentIndicator.php includes the entity keys in the annotation:

```
* entity_keys = {
* "id" = "machine",
* "label" = "human_name",
* "weight" = "weight"
* },
```

`human_name` isn't a key used anywhere else, including in the config_export object in the same annotation. I think this should be `name`.

Modules that use config annotations, like config_sync, throw Exceptions because the key identified as the key identified as the label in the Entity annotation does not exist on actual config objects. Besides which, `EnvironmentIndicator::label()` gets the `name` property.

In effect, config_sync is looking for what key to use for the label of the config entity by looking at the entity_keys definition, then not being able to find that key on any config and erroring.

Not so easy to reproduce, but easy to fix.

Proposed resolution

set "label"="name" in the entity annotation

🐛 Bug report
Status

RTBC

Version

4.0

Component

Code

Created by

🇺🇸United States calebtr

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024