I am getting a problem where the widget doesn't render in the field settings form. I am currently using the widget for selecting existing references to a media entity, and when I go into the field settings, the default value does not render at all. I will attach a screenshot. There are no errors in the console nor in the database log.
Currently, in order to change the default value, I have to switch the widget to use a non ief widget, and then switch the widget back after saving. I would appreciate all the help.
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#8 | Screen Shot 2019-05-02 at 9.23.06 PM.png | 82.1 KB | bobbysaul |
#8 | Screen Shot 2019-05-02 at 9.23.29 PM.png | 65.89 KB | bobbysaul |
#8 | Screen Shot 2019-05-02 at 9.27.41 PM.png | 70.54 KB | bobbysaul |
#7 | Screen Shot 2019-05-02 at 7.47.01 AM.png | 32.21 KB | neeravbm |
#7 | Screen Shot 2019-05-02 at 7.46.50 AM.png | 17.4 KB | neeravbm |
Comments
Comment #2
bobbysaul CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: bobbysaul commentedThe saving problem is fixed by adjusting the extractFormValues function to check if existing nodes are allowed.
Comment #5
bobbysaul CreditAttribution: bobbysaul commentedHere is the patch of what I stated above.
Comment #6
bobbysaul CreditAttribution: bobbysaul commentedComment #7
neeravbm CreditAttribution: neeravbm at Red Crackle 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 CreditAttribution: 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 CreditAttribution: xenophyle commentedThank you very much @bobbysaul. This patch solved this mysterious bug.
Comment #10
gaurav_manerkar CreditAttribution: gaurav_manerkar commentedCan we implement same for Inline form - simple ?
Comment #11
geek-merlinThat one needs a failing test to go in.