Updated: Comment #0
Problem/Motivation
Most config entity delete forms do largely the same thing with the exception of the labels/paths etc.
If we add an admin_path annotation to config entities, really all of the meta-data required for the delete form is found in the entity annotation - eg the entity type label forms the 'Are you sure you want to delete the %entity_type_label %label' the module and entity type label can power the watchdog entry and the message displayed. The admin path can handle the redirect/cancel logic too.
This dovetails nicely with #2089757: Auto generate routing entries for entities based on an 'admin_path' and 'admin_permission' annotation but the relevant bits of that patch are included here, including the change to the route id.
Proposed resolution
Provide a ConfigDeleteFormBase that meets most common requirements
Remaining tasks
Decide if this is a worthwhile inclusion. It may well be that its not.
See if tests pass and fix if needed
Identify other config entity delete forms that might be candidates for removal
Review
User interface changes
None
API changes
New base class
Related Issues
#2089757: Auto generate routing entries for entities based on an 'admin_path' and 'admin_permission' annotation
#2085429: Provide a simple list controller for config entities.
Comment | File | Size | Author |
---|---|---|---|
config-entity-delete.patch | 5 KB | larowlan | |
Comments
Comment #1
tim.plunkettI'm +1 on the idea.
Here and elsewhere: $this->t()
Use 'provider', not 'module'
This seems a little late to be throwing this. Maybe in buildForm?
Comment #3
larowlanComment #4
Berdir#1728804: Introduce (Content)EntityDeleteForm and children to handle entity deletions :)