Updated: Comment #0
Problem/Motivation
Entity Reference module uses hook_field_info_alter() to change the default class of entity reference items from EntityReferenceItem
to ConfigurableEntityReferenceItem
. That means that as soon as you turn on the module things such as $node->uid
are an instance of the latter and not the former.
Because ConfigurableEntityReferenceItem
changes the schema, however, relative to EntityReferenceItem
(it adds the 'revision_id' column) that means that e.g. $node->uid
has a different schema depending on whether Entity Reference module is installed or not.
Currently the field item schema is unused which is why this hasn't cropped up. With #2183231: Make ContentEntityDatabaseStorage generate static database schemas for content entities, however, that situation would change and things could blow up massively depending on when you turn on Entity Reference module.
Proposed resolution
A: Do not unilaterally alter the field item class. Only use ConfigurableEntityReferenceItem
for configurable fields.
B: Move the 'revision_id' (probably as 'target_revision_id' ?!) schema column and the general ability to reference revisiosn into EntityReferenceItem
. Possibly add a corresponding setting to toggle that behavior.
Remaining tasks
User interface changes
-