Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
As a followup of https://www.drupal.org/node/2669802. We noticed that most forms extending ContentEntityForm implement the things below (and not all in the same way). It might be good to standardize this a bit more in ContentEntityForm. This means less logic for people implementing it.
Form():
- Standardize form title: $form['#title']
Save():
- Saving the entity
- Standardize message for new/changed entities
Maybe some more?
Proposed resolution
- Discuss what to standardize and how.
- Actually change the code.
Comments
Comment #2
phenaproxima100% in favor of this.
Comment #3
chr.fritschWe could move the publish/unpublish button logic from the ::actions() into the base class and call that depending on the entity is implementing EntityPublishedInterface
Comment #4
BerdirRe #3: Please not :)
I want to kill that UI pattern: #2068063: Change "Save and keep un-/published" buttons to a "Published" checkbox and an included "Save" button