Implement Inline entity form hook hook_inline_entity_form_entity_form_alter to alter the node form.

Comments

jherencia’s picture

StatusFileSize
new1.3 KB
new1.66 KB
bojanz’s picture

This doesn't look right.

Seems to me that this module should implement hook_inline_entity_form_entity_form_alter() besides the usual alter, so that IEF is covered as well.

jherencia’s picture

StatusFileSize
new1.05 KB
new1.4 KB

Ok, here is a new attempt :).

bojanz’s picture

+ $entity_form['title']['#value'] = 'ant';

Huh?

jherencia’s picture

http://drupalcode.org/project/auto_nodetitle.git/blame/HEAD:/auto_nodeti...

It's in right now, but I haven't analyze the code enough so do not know why either.

marvil07’s picture

After a black-box test on the patch at #3 it seems to work fine.

imclean’s picture

#3 works for me as well, thanks.

froboy’s picture

Status:Needs review» Reviewed & tested by the community

Node title is required on submission, so I'm assuming that this is just assigning an arbitrary string to #value so that it can be generated later.

Also, this seems to have tested well, so any chance of getting it committed?

dww’s picture

+1 that #3 is RTBC.

Tested and it solves the problem.

Reviewed the code and found no objections. I thought it was a shame that it sort of duplicates so much of auto_nodetitle_form_node_form_alter() but they're both small functions and enough details are different that trying to merge them is going to make the code worse.

Inline Entity Form is becoming the defacto standard for solving the problem of creating new entities for an entity_reference field in D7. I think it's worth it for auto_nodetitle to add this extra code to properly support that module.

Thanks!
-Derek

-enzo-’s picture

I tested the patch #1719948-3: Integration with inline entity form and works perfectly, please apply in next release

_vid’s picture

Confirming patch #1719948-3 applies cleanly to both 7.x-1.x-dev and 7.x-1.0. Thanks all for working on this.

_vid’s picture

Issue summary:View changes

Change hook to implement.

StryKaizer’s picture

Issue summary:View changes
StatusFileSize
new1.63 KB

I altered patch in #3 to ensure this patch is also working when the title module is active (which replaces the title field).

Changes attached

StryKaizer’s picture

StatusFileSize
new1.71 KB

Ignore #12, uploaded new file which fixes the title module too in inline entity forms.

mariusm’s picture

I can not apply patch 1719948-13.patch
"The chunk size did not match the number of added/removed lines"

I change
@@ -39,6 +39,25 @@ function with
@@ -39,6 +39,34 @@ function

vadym.kononenko’s picture

StatusFileSize
new1.71 KB

#13 patch is malformed.
I've fixed it as it was described in #14 (https://drupal.org/comment/8187367#comment-8187367).

Updated file was attached.

JMC’s picture

#15 patch works for me on 7.x-1.x-dev, thanks!

potassiumchloride’s picture

#15 works for me on 7.x-1.x-dev. Thank you so much!

aytee’s picture

Patch #15 worked for me. Just what I needed. Thanks!

tsi’s picture

+1
#15 works for me too

rcodina’s picture

Patch #15 works for mee too! Please, do a 2015 release of this module with this. Current stable release is from 2011, too old!

Thanks!