One thing that is lacking in my application of the inline entity form is having a way to load an existing entity into the form. The most straightforward way I found was to add an alter hook to modify $items (and allow it to modify $form_state via the $context variable of the drupal_alter() function call.

CommentFileSizeAuthor
#1 alter_items_hook-1971832-1.patch1013 bytescuebix

Comments

cuebix’s picture

StatusFileSize
new1013 bytes

Patch is provided. A module would basically need to provide some sort of UI for entity selection via hook_field_widget_form_alter. The hook provides a way for it to change the inline entity id (in $items) before the inline entity form widget loads the entity. When an id is changed, the module will also need to set the appropriate key in $form_state['input'] to null so that inline entity form will re-generate the form.

bojanz’s picture

Status: Needs review » Closed (won't fix)

I think this is out of scope for IEF.
You can write your own widget, or prefill the entityreference field before loading the widget, or just wrap the IEF widget (your widget calls the IEF widget function).