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
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3315851--update-annotation-for-entity-keys.patch | 458 bytes | calebtr |
Issue fork environment_indicator-3315851
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
Comment #4
immaculatexavier commentedCommitted in accordance to the proposed resolution
Comment #5
calebtr commentedThanks 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.
Comment #6
calebtr commentedHere is a patch file in case it helps anyone else.
Comment #7
ankitjhakal commentedHi 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.
Comment #8
ankitjhakal commentedComment #9
trackleft2+1 RTBC for the Merge Request or the Patch
Comment #12
isholgueras commentedI've tested in local and I haven't seen any issue with an existing site or a new installed site. Thanks!