Closed (outdated)
Project:
Inline Entity Form
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2014 at 18:44 UTC
Updated:
6 Feb 2021 at 16:27 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bojanz commentedCommitted, thanks.
Comment #4
fearlsgroove commentedI'm not sure why this worked before, but it's definitely broken now. Attached patch ensures that only child forms of the delta that's being submitted are closed. Lightly tested with all the scenarios I could think of -- 2 levels of nesting.
Comment #5
m4oliveiHere is a patch for Drupal 8. So far working for me. Anyone out there want to check this out?
Comment #7
m4oliveiComment #10
m4oliveiOops, re-uploading patch and setting to test against 8.x. Apologies.
Comment #11
bojanz commentedIf there's a bug, then we first need tests to prove it.
Comment #12
m4oliveiSure, sorry it took so long for me to get to it. Will this suffice? I added a test case to ComplexSimpleWidgetTest. It tests the Cancel button for two open edit entity inline forms and for an open entity edit and open entity create inline forms. I also adjusted the method by which the parent form element is chosen for closing itself and children so that if you have a lot of nesting happening, only from the right level down are things closed up.
Comment #13
m4oliveiFound a case where this still isn't working:
* Create an entity using an inline entity form.
* Open the IEF Create form
* Open the IEF edit form
* Click Cancel on the edit form.
* Both forms close.
Comment #14
m4oliveiComment #15
m4oliveiThis updates the test to be more clear what we are testing and the different test cases we'd like to check. This introduces an additional assertion to test the issue found in my last comment, so altogether we now test:
* Two open IEF edit forms, Cancel one, other should remain open.
* One open IEF edit form, open IEF create form. Cancel create form, edit form should remain open.
* One open IEF edit form, open IEF create form. Cancel edit form, create form should remain open.
At this state of the patch, expecting the last case to fail as per my last comment. Fix to follow soon.
Comment #16
m4oliveiComment #18
m4oliveiWow, this is a tricky one. So I've changed my approach with this latest patch. I realized that
InlineEntityFormComplex::closeFormis applicable to the create form andInlineEntityFormComplex::submitCloseRowis applicable to the edit forms. Also that,InlineEntityFormComplex::closeChildFormsin it's current form is too broad, it will always close from the top level of the widget down, closing everything when used (currently used on Create -> Cancel and Edit -> Cancel). This latest patch setups the correct callbacks for each scenario (Create -> Create, Create -> Cancel, Edit -> Update, Edit -> Cancel). It also revisesInlineEntityFormComplex::closeChildFormsto properly act on the nearest inilne_entity_form parent downwards when closing child forms.Should pass the testing now.
Comment #21
m4oliveiHere's one that fixes the PHP warnings.
Comment #23
m4oliveiHum, seems there is a problem with adding existing now. Boo. Will test in the AM.
Comment #24
m4oliveiYep found the regression. Hopefully this fixes it.
Comment #25
m4oliveiComment #26
pryrios commentedThis is still happening for me on 7.x-1-x. If I have two same-level Entity Forms opened and cancel one of them, they both close.
Comment #27
nkoporecTrying to reproduce the issue but I can't. I have nested forms and all forms close or submit separately, is this issue still active in the latest dev. branch?
Comment #28
edwardchiapetI am also unable to reproduce this issue on 8.x-1.x-dev.
Comment #29
joachim commentedComment #30
geek-merlinComment #31
geek-merlin