- Issue created by @idebr
- Status changed to Postponed: needs info
over 1 year ago 3:49pm 15 August 2023 - πΊπΈUnited States robphillips
Please add specific steps to replicate. Tried on the default article (node) content type to no avail. Furthermore, the code is always using the current form display to get the applicable steps (see https://git.drupalcode.org/project/entity_form_steps/-/blob/1.x/src/Form...). Most entity delete forms, such as
NodeDeleteForm
, are derived fromContentEntityConfirmFormBase
which isn't using form display modes. - π§πͺBelgium chewi3
I haven't tested from a clean Drupal install, but the way it is currently set up does seems like a possible problem.
The entity_form_steps_form_alter hook checks if the form object is an instance of ContentEntityFormInterface. ContentEntityConfirmFormBase extends ContentEntityForm, so the node delete form is also altered.
Usually you only have the "default" form display mode. So if this is the form mode that has the step field groups, they will also be retrieved for the delete form (since it tries to look for a "delete" form mode, but defaults to the "default" form mode.
I did fix our problem by adding an extra content form mode next to the default. By adding an "edit" form mode with the steps and removing the steps from the default, the issue is fixed.
Not sure what a good fix would be, if it is even needed. I did add a patch with a possible solution (checking the form state operation and only altering the form when in 'edit mode'), so feel free to review if something like this could be helpful to add.
- π§πͺBelgium chewi3
In my previous comment I forgot to account for node creation (which seems to correspond to the "default" operation). Which also means my fix needs to be slightly adjusted (I guess I can specifically add a "delete" content form mode instead and do it the other way around).
Adding an updated patch.
-
Chewi3 β
authored 2570d832 on 1.x
Issue #3381191 by Chewi3: Entity form steps are also applied to the...
-
Chewi3 β
authored 2570d832 on 1.x
- Status changed to Fixed
over 1 year ago 2:12pm 16 August 2023 - πΊπΈUnited States robphillips
Thanks! Didn't initially realize the entity delete form ultimately extends the base entity form. Opted to target the delete operation because module builders have the option to define additional operation types. And moved the conditional into
EntityFormSteps.php
. Automatically closed - issue fixed for 2 weeks with no activity.