Problem/Motivation
#3246699: Add "Save and Edit Layout" button to entity edit pages introduced the Save and edit layout button on create and edit entity forms. Unfortunately the if-condition that checks for an instance of ContentEntityFormInterface results in the button being added to any entity form implementing that interface (except the delete form of course)
Steps to reproduce
- Install
layout_builder_save_and_editmodule - Build a custom entity form class that implements
ContentEntityFormInterfaceor extendsContentEntityFormclass for an entity type/bundle that has layout builder with overrides enabled - Create a route that displays that form -> see the
Save and edit layoutbutton being added
Proposed resolution
- Ensure that the
Save and edit layoutbutton is only added entity forms for relevant operations (e.g. seeaccess_unpublishedmodule code for a similar solution at https://git.drupalcode.org/project/access_unpublished/-/blob/8.x-1.x/src...
Remaining tasks
- Create a patch/MR that fixes this issue
User interface changes
Save and edit layoutbutton will only be added to relevant forms anymore
API changes
n/a
Data model changes
n/a
Issue fork layout_builder_save_and_edit-3419536
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
hctomComment #4
hctomPlease see the issue fork and MR for a proposal to fix this issue.
Comment #5
jastraat commentedThis fixed our issue where the save and edit layout button was appearing in the forms for scheduled_transitions. Simple change that only adds the button where it makes sense.
Comment #6
jastraat commentedCould a maintainer please look at this? I'm disappointed a new release was made without getting this merged.
Comment #9
neslee canil pinto