Needs work
Project:
Inline Entity Form
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Mar 2019 at 18:26 UTC
Updated:
1 Aug 2022 at 19:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bobbysaul commentedI believe the issue is with the canBuildForm function in the InlineEntityFormBase.php.
This needs to be adjusted for the InlineEntityFormComplex if it allows the use of existing entity references.
Comment #3
bobbysaul commentedI was able to add the canBuildForm function to the complex widget, and add the check if allowed to use existing nodes.
The only problem now is the value won't save. The widget will build now. I just need to be able to save the default value selected.
Comment #4
bobbysaul commentedThe saving problem is fixed by adjusting the extractFormValues function to check if existing nodes are allowed.
Comment #5
bobbysaul commentedHere is the patch of what I stated above.
Comment #6
bobbysaul commentedComment #7
neeravbm commented@bobbysaul I am not able to reproduce this issue. When referencing an existing Media content using IEF, I do see an "Add existing media" button. On pressing this button, I get an autocomplete form to reference an existing file/image. It's possible that our settings our different. I have attached images of my configuration below. Can you provide steps to reproduce the issue?
Comment #8
bobbysaul commented@neeravbm, I think that my problem was misunderstood. I am able to get the field to render on the normal form (node/add/test). The problem is that the field does not render on the field settings form when setting the default values (admin/structure/types/manage/test/fields/node.test.field_media).
Here is a screen shot of the widget settings (I have matched the same as you):

This is a screen shot of the field settings form before the patch (notice the details element labeled 'DEFAULT VALUE'):

This is a screen shot of the same page after applying the patch (see how the field widget is now nested in the 'DEFAULT VALUE' detail):

Comment #9
xenophyle commentedThank you very much @bobbysaul. This patch solved this mysterious bug.
Comment #10
gaurav_manerkar commentedCan we implement same for Inline form - simple ?
Comment #11
geek-merlinThat one needs a failing test to go in.