Problem/Motivation

In #1959806: Provide a generic 'entity_autocomplete' Form API element, the entity_autocomplete form element requires you to manually concatenate and append entity IDs to entity labels for #default_value.

Proposed resolution

TBD.

Remaining tasks

Discuss if we can improve the DX.

User interface changes

Nope.

API changes

Tiny ones.

Comments

dawehner’s picture

Ideally the default value could be the entity ID and some process function replaces its value with the proper value?

amateescu’s picture

Status: Postponed » Closed (duplicate)

This is being handled in #2419923: Port SA-CONTRIB-2013-096 to D8.

@dawehner, only having the entity IDs is not enough, we have to take care of "autocreated" entities too, they are not yet saved in the database so they have no ID.

So I think the only reasonable thing to expect is full entity objects, like I did in the patch from #2419923-23: Port SA-CONTRIB-2013-096 to D8.