Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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()
Comment | File | Size | Author |
---|---|---|---|
#6 | 2366877.6.patch | 4.72 KB | alexpott |
#6 | 2366877.string-test-only.patch | 2.63 KB | alexpott |
#1 | 2366877.1.test-only.patch | 1.5 KB | alexpott |
#1 | 2366877.1.patch | 2.06 KB | alexpott |
Comments
Comment #1
alexpottHere's a patch to fix this a tests the missing
target_uuid
.Thinking how to test the string id thing.
Comment #3
alexpottComment #4
Gábor HojtsyComment #5
Gábor HojtsyBTW 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).
Comment #6
alexpottHere's a patch that adds a test for referencing entities with string IDs. The interdiff is the test only patch :)
Comment #8
Gábor HojtsyIt is comfy that the EntityTestStringId entity type was already available indeed. Added test looks great.
Comment #10
webchickCommitted and pushed to 8.0.x. Thanks!