In order to get Auto nodetitle work with IEF (see #1719948: Integration with inline entity form) it is needed the node controller to call node_submit and hook_node_submit.

Comments

jherencia’s picture

Title: Let modules alter node submition » Let other modules execute hook_node_submit
StatusFileSize
new779 bytes
new1.14 KB
jherencia’s picture

StatusFileSize
new1.15 KB
new786 bytes

I've fixed a bug in the previous patch.

bojanz’s picture

Status: Needs review » Needs work

Blurgh, D7 still has some crappy code.

You're passing $form_state to hook_node_submit, that's the form state of the parent form, not of the embedded node form.
That won't work for obvious reasons (autonodetitle uses $form_state['values']['title'], for example).

Perhaps just construct a fake form state that contains just values:

$fake_form_state = form_state_defaults();
$fake_from_state['values'] = drupal_array_get_nested_value($form_state['values'], $entity_form['#parents']);

and hope that works?

jherencia’s picture

Status: Needs work » Needs review
StatusFileSize
new953 bytes
new1.29 KB

You are right.

bojanz’s picture

Committed.

bojanz’s picture

Status: Needs review » Fixed

Closing issue.

Status: Fixed » Closed (fixed)

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

aitala’s picture

Issue summary: View changes

Hi,

I think I'm still having an issue with Auto nodetitle and IEF - I'm still getting the node title field showing up, when it should be hidden, and being required.

I can complete the IEF form, but the new node comes back with no title. If I edit it, still no title.

The only things that 'works' is to add the node containing the IEF, then go back and edit the IEF node. If that makes sense.

E