Hey there!
Working on a Drupal distribution. Lots of fun stuff to do with this build. I'm using inline entity form. I am using inline entity reference for nested inline entities, or at least attempting to.
Here's the issue and how to reproduce it:
Create parent content type.
Create child content type
Create grandchild content type.
Parent has inline form for child.
Child has inline form for grandchild.
Go to create parent node form.
Add child node via entity form.
Add grandchild node via entity form.
Crate another child node via entity form.
That second child node, will inherit the created grandchild for the first child node.
Once the parent node is saved, all subsequent actions are 100% okay.
Any ideas? Is this a duplicate? I wasn't able to turn anything up.
Comment | File | Size | Author |
---|---|---|---|
#7 | inline_entity_form-nested-inline-entity-form-2206197-6.patch | 1.44 KB | adolfo.mansilla |
#3 | inline_entity_form-nested-inline-entity-form-2206197-3.patch | 5.61 KB | adolfo.mansilla |
Comments
Comment #1
bojanz CreditAttribution: bojanz commented1.5 has very fresh code for handling nested IEFs, I am guessing there are still a few bugs to shake out.
I'll try to reproduce.
Comment #2
jnicola CreditAttribution: jnicola commentedThanks for responding! I can toss you the DB for the project I'm working on. Nothing critical in there, all test content and fake users.
I'm working in Turnkeylamp, php 5.4, etc etc.
Comment #3
adolfo.mansilla CreditAttribution: adolfo.mansilla commentedI have made some changes in the module. I can create and modify nested nodes with 3 deep levels.
Comment #4
jnicola CreditAttribution: jnicola commentedI'll try and find time to test this!
Does your patch work on NODE creation? I can get it to work on subsequent edits, but the issue appears related to a lack of a parent NID on initial node creation.
Comment #5
adolfo.mansilla CreditAttribution: adolfo.mansilla commentedYes, I tested it with content types.
Comment #6
bojanz CreditAttribution: bojanz commentedI would not commit a patch such as the one in #3. It's hacky and tackles the problem at the wrong place.
IEF has fresh and powerful nesting code, the issue here is that previous form values are getting reused for a newly opened form.
Based on that, guessing that the actual bug is in inline_entity_form_cleanup_entity_form_state().
Comment #7
adolfo.mansilla CreditAttribution: adolfo.mansilla commentedThanks for the tip. I been working on the issue. I uploaded the patch with new changes.
Comment #8
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedPatch in #7 wfm. Thanks
Comment #9
monaw CreditAttribution: monaw commentedWhat's happened with this patch to fix the problem of duplicate nested grandchildren?
Comment #10
xlyz CreditAttribution: xlyz commented#7 wfm as well. thanks
Comment #11
jnettikSame problem. #7 works for me too. I'm marking as RTBC. I also tested the patch against current dev.
Comment #12
metafunk CreditAttribution: metafunk commented#7 works for me as well.
Is there any chance this will be rolled into the next release?
Comment #13
bojanz CreditAttribution: bojanz commentedCommitted, thanks.
Comment #16
jmdall CreditAttribution: jmdall commentedJust to inform that I still having the same issue but more "randomly" with the latest dev version.
Haven't found a way to reproduce it right now.
Comment #17
drupalninja99 CreditAttribution: drupalninja99 at Mediacurrent commentedGetting errors on node/add page when I add a new inline entity:
Notice: Undefined index: field in field_widget_field() (line 578 of ../modules/field/field.form.inc).
Notice: Undefined index: instance in field_widget_instance() (line 603 of ../modules/field/field.form.inc).
The ajax throbber just spins. Adding existing entities works and adding a new inline entity on an existing node works.
Comment #18
drupalninja99 CreditAttribution: drupalninja99 at Mediacurrent commentedAlso Notice: Undefined index: #ajax in ajax_form_callback() (line 391 of ../includes/ajax.inc).
Comment #19
adolfo.mansilla CreditAttribution: adolfo.mansilla commentedMore info about the error please. Installed modules, fresh install, custom fields, etc.
Comment #20
drupalninja99 CreditAttribution: drupalninja99 at Mediacurrent commentedIt's not a fresh install, altho I could test it against a fresh install. There are all manner of modules, custom fields, etc. too many to name. I am going to investigate further.
Comment #21
drupalninja99 CreditAttribution: drupalninja99 at Mediacurrent commentedI did a clean install and enabled a couple features to enable the content type. I still have the problem. I do have translation modules enabled include a patch for inline entity forms.
Comment #22
drupalninja99 CreditAttribution: drupalninja99 at Mediacurrent commentedDoing some more testing it does look like this is a multilingual / inline entity problem so the issue is likely not with this patch.
Comment #23
jphelan CreditAttribution: jphelan commentedI'm having this issue but the nested field inside the inline entity is a paragraphs field, not another inline entity. Any idea how to revise this patch to cover that scenario as well?
Comment #24
jphelan CreditAttribution: jphelan commentedI'm having this issue in D8 as well.
https://www.drupal.org/node/2877484
Comment #25
anthonyalbertyn CreditAttribution: anthonyalbertyn commentedI have the same problem as the original description on this bug on D7, but only when a field collection is used.
I have a landing page, and on that an entity reference field (set to multiple ). I have another content type (lets call it Component 1) and on that I have a field collection field (set to multiple) and on the field collection field I have an entity reference field (set to multiple).
When I create a new landing page, then use the entity reference on the landing page to add an instance of Component 1 to it, and then on Component one add a node via its entity reference field, then before saving the landing page, click add button to add a second instance of Component 1, then I can see then in the inline entity reference table on the second issuance of Component 1, I can see the referenced node from the first instance of Component 1.
If I remove the field collection from Component 1 and just have an entity reference on component 1 (ie not via a field collection) and repeat the above content adding then I do not experience the bug.
My site is multilingual but I have tested this on a fresh non multilingual Drupal 7 install and the same is true. Use a field collection in the chain and the bug is there, do not use a field collection and the bug is gone.
I am not sure whether I should create a new bug report, and whether this should be on the field collection module or on the inline entity reference form module. Any suggestions?
Comment #26
Robert Castelo CreditAttribution: Robert Castelo as a volunteer and at Code Positive Services commentedSee also this issue:
https://www.drupal.org/node/1991796