I'm using IEF in a Content Translated node. When creating the parent's translation, I want the sub nodes to be copied (so new nids), instead of reused in the new node. To do this, I want to copy the data from the existing sub nodes and show it in the open IEFs in the parent node. (Widget is IEF Multiple Values.)
The perfect moment to do this (open the forms) is JUST before the widget logic runs, but after its start, because that's where the entities and IEF settings are collected. The stuff to alter is $form_state['inline_entity_form'][$ief_id]['entities'], because that's where the 'form' => 'edit' decides what to do in the rest of the function.
Specifically, want I need is a form alter in inline_entity_form_field_widget_form() just before // Build the appropriate widget..
Patch coming.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | inline_entity_form-2612520-2.patch | 550 bytes | rudiedirkx |
Comments
Comment #2
rudiedirkx commentedPatch does just that. Add a very simple form alter.
The alterable is certain, but I'm not sure about the context arguments.
$form_stateis always useful, but maybe so is$form, or$element?Patch is against 1.6, not 1.x, so it might have lines offset.
Comment #3
spadxiii commentedLooks good and works fine. Should not give any backwards-compatibility problems at all.
Comment #4
tessa bakkerComment #6
ram4nd commented