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

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

calebtr created an issue. See original summary.

immaculatexavier made their first commit to this issue’s fork.

immaculatexavier’s picture

Status: Active » Needs review

Committed in accordance to the proposed resolution

calebtr’s picture

Thanks for responding so fast! The code looks right. I'm not sure how to test the gitlab fork. I'll roll myself a local patch.

calebtr’s picture

Here is a patch file in case it helps anyone else.

ankitjhakal’s picture

Assigned: Unassigned » ankitjhakal
Status: Needs review » Reviewed & tested by the community

Hi Calebtr, Applied patch on local, working fine. Tested on local by creating, deleting entity. There was no error in dblog after applying this so moving this to RTBC status.

ankitjhakal’s picture

Assigned: ankitjhakal » Unassigned
trackleft2’s picture

+1 RTBC for the Merge Request or the Patch

isholgueras made their first commit to this issue’s fork.

isholgueras’s picture

Status: Reviewed & tested by the community » Fixed

I've tested in local and I haven't seen any issue with an existing site or a new installed site. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.