Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300751

[D7] Field API assumes serial/integer entity IDs, but the entity system does not

$
0
0

Problem/Motivation

Entities can be created with non numeric IDs but the field system assumes that entities have a numeric ID.
Currently entities with non numeric IDs aren't fieldable.

Proposed resolution

Add a new setting on entities to specify the entity ID type. Starting with support for strings for now.
Add a new setting on field definitions that contains the entity key type.
If a field is added via the UI then we can set the type off of the target entity. If a field is added programmatically then the type can be added into the array passed to field_create_field().

In the field schema add an override that checks if the entity ID type is set and adjusted the entity_id and revision_id columns to be VARCHAR rather than INT.
If we keep this as an override then it does not break backwards compatibility as well.


Viewing all articles
Browse latest Browse all 300751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>