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.

CommentFileSizeAuthor
#2 inline_entity_form-2612520-2.patch550 bytesrudiedirkx

Comments

rudiedirkx created an issue. See original summary.

rudiedirkx’s picture

Status: Active » Needs review
StatusFileSize
new550 bytes

Patch does just that. Add a very simple form alter.

The alterable is certain, but I'm not sure about the context arguments. $form_state is always useful, but maybe so is $form, or $element?

Patch is against 1.6, not 1.x, so it might have lines offset.

spadxiii’s picture

Status: Needs review » Reviewed & tested by the community

Looks good and works fine. Should not give any backwards-compatibility problems at all.

tessa bakker’s picture

Version: 7.x-1.6 » 7.x-1.x-dev

  • ram4nd committed cb1c3cb on 7.x-1.x
    Issue #2612520 by rudiedirkx, SpadXIII: Alter form state just before...
ram4nd’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.