Problem/Motivation
If you customize the entity keys in a custom ExternalEntity based class,
Steps to reproduce
- Configure an external entity type
- Create a custom class extending ExternalEntity
- Change an entity key like 'published' to something else.
- ExternalEntity will still add the published field hardcoded as 'status'.
Proposed resolution
Use $entity_type->getKey('KEY') when declaring the id, label/title and published/status base fields.
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Issue fork external_entities-3554518
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 #3
guignonvYes, you're right. I fear there are other places where the
->getKey()should have been used and was not. Did you check everywhere in current code?Anyway, many thanks for the simple fix.
Comment #5
twodI searched those field strings but I did not find any other places where I was sure it was correct to use that method. For example 'status' was only used in other contexts which do not refer to that field.
Comment #6
guignonvThanks! :)