Problem/Motivation
As content editor, for some fields and referenced entities, you may want the inline entity form to automatically open in "edit" mode as soon as you start editing the main entity. In order to save multiple useless clicks.
Proposed resolution
Provide a field widget setting for the inline entity form complex widget that allows to check "auto-open the edit form".
Issue fork inline_entity_form-3247446
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
filsterjisah commentedComment #4
filsterjisah commentedComment #5
filsterjisah commentedRemoved unwanted code formatting.
Comment #7
anybodyEspecially for a cardinality of "1" (single referenced entity) this would be a HUGE UX benefit!
I'm not sure if this also makes the same sense for multi-value references, but for single values it definitely saves one click and a better workflow!
Here's an example of the current results with the advanced widget referencing a single block_content. You see, why it's not the best you can imagine being forced to always do the Edit ("Bearbeiten") extra click:

The patch is a good first step, but I think the edit form should then also contain the option to remove the entity.
Comment #8
filsterjisah commentedDepending on the case it can always makes sense to open references, either multiple values or just a single one.
This patch follows the inline entity form module:
- first hit the "cancel" button in the edit form
- click the "delete" button in the list form
I guess it make sense to add a delete button on the edit form as well. Feel free to make a patch update suggestion ;)
Comment #9
filsterjisah commentedFor my implementation the inline entity form widget is a required field. So deleting the reference (many many fields) is not really needed, just editing the fields of the reference is ok. When referenced entities are also managed somewhere global, this changes things.
Comment #10
anybody@filsterjisah thanks, yes, I didn't mean to criticize anything. In the opposite, agreed with your idea and added some further points and arguments.
I guess best would be to first have maintainer feedback before proceeding with the implementation. This has UX implications which should be signed off first, I think.
Comment #11
geek-merlinThanks @Anybody for doing some issue gardening, i really appreciate that.
Working this through...
The feature sounds reasonable, tentative green light for that.
The new function prepareFormState in this issue looks overly complex, but this can be mitigatzed. I'm also open to suck the other issue in here.
So this might mean:
- Move logic from prepareFormState to the place used in the other issue's patch
- Close the other issue as dup of this one
- Add in the feature of the other issue (i don't think we need a setting for that) (and find better query parameter names)
- Manually test
- Add automatic tests
What u think?
Comment #12
podarokComment #13
bharath-kondeti commentedI will work on the patch re-roll
Comment #14
bharath-kondeti commentedPatch re-rolled against 2.0.x branch. Please review
Comment #16
podarokComment #18
geek-merlinBulk reopen.
Comment #19
geek-merlinAs the issue tag states, this needs tests to be committed.
Comment #20
jonathanshawThe approach proposed here does not handle well the situation of nested IEFs, when Cancel is pressed on the parent IEF. This is because of inline_entity_form_close_all_forms() I think, that function seems to override what this patch does.
Comment #21
geek-merlin@jonathanshaw
I don't grok it fully but maybe you can describe the exact steps that uncover the problem you describe, the chances that your objection gets into the tests drastically increase.
Comment #22
jonathanshawRe #20 from memory:
1. Sitebuilder: Nest once complex IEF inside another
2. Sitebuilder: Set the inner one to auto open
3. User: Open an entity in the outer IEF; SUCCESS the inner IEF auto opens properly.
4. User: Cancel the opened outer IEF
5. User Open the same entity again in the outer IEF; FAILURE the inner IEF does not auto open now!
Comment #25
dcam commentedI closed #2792971: Expand inline entity form widget setting as a duplicate. I'm granting credit to @vyasamit2007 and @rhovland for work done on a patch in that issue. But the patch was fairly similar. I don't know that there's anything that would be useful from it.
Everyone please remember to check for existing issues before opening a new one. Today I've closed two issues that were older than this one.
Comment #26
filsterjisah commentedPatch re-rolled against 3.0.x branch.