The schema for the Entity Reference field is incorrect because it says that the entity id is an integer. This does not have to true - see #1823494: Field API assumes serial/integer entity IDs, but the entity system does not

We are also missing a schema for the 'target_uuid' key/value that is added by EntityReferenceFieldItemList::processDefaultValue()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott’s picture

Status: Active » Needs review
FileSize
2.06 KB
1.5 KB

Here's a patch to fix this a tests the missing target_uuid.

Thinking how to test the string id thing.

Status: Needs review » Needs work

The last submitted patch, 1: 2366877.1.test-only.patch, failed testing.

alexpott’s picture

Status: Needs work » Needs review
Gábor Hojtsy’s picture

Gábor Hojtsy’s picture

BTW the patch looks good. We need an entity type with a non-numeric id to test this I guess. That should already exist in core, no? If we only want to test the persistence, we can set whatever value we want, unless there is some strict data checking on entity references (in which case that would be delegated to the target entity type I guess, so we need that entity type anyway).

alexpott’s picture

Here's a patch that adds a test for referencing entities with string IDs. The interdiff is the test only patch :)

The last submitted patch, 6: 2366877.string-test-only.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

It is comfy that the EntityTestStringId entity type was already available indeed. Added test looks great.

  • webchick committed 0577d20 on 8.0.x
    Issue #2366877 by alexpott: Fixed Entity Reference field schema...
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.0.x. Thanks!

Status: Fixed » Closed (fixed)

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