Problem/Motivation

If you customize the entity keys in a custom ExternalEntity based class,

Steps to reproduce

  1. Configure an external entity type
  2. Create a custom class extending ExternalEntity
  3. Change an entity key like 'published' to something else.
  4. 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

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

twod created an issue. See original summary.

guignonv’s picture

Status: Needs review » Fixed

Yes, 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.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

twod’s picture

I 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.

guignonv’s picture

Thanks! :)

Status: Fixed » Closed (fixed)

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