By chr.fritsch on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.6.x
Introduced in version:
8.6.0
Issue links:
Description:
In #2670730: Provide a delete action for each content entity type generic entity delete action plugins were introduced. In favor of that, the following action plugins are now deprecated:
- Drupal\comment\Plugin\Action\DeleteComment
- Drupal\node\Plugin\Action\DeleteNode
Existing plugins that extend one of the mentioned ones, should now extend Drupal\Core\Action\Plugin\Action\DeleteAction.
In order to benefit from this new action plugin, entity type definitions have to be adjusted.
- A "delete-multiple-confirm" form handler has to be set to
Drupal\Core\Entity\Form\DeleteMultipleForm. It's also possible to use your own delete form class to modify the messages for example. SeeDrupal\node\Form\DeleteMultiple - Make sure the
Drupal\Core\Entity\Routing\DefaultHtmlRouteProvideris used. IfDrupal\Core\Entity\Routing\DefaultHtmlRouteProvidercan not be used, define a "entity.my_entity_type.delete_multiple_form" route. - Define a "delete-multiple-form" link relation.
/**
* @ContentEntityType(
* id = "my_entity_type",
* label = @Translation("My entity type"),
* handlers = {
* "form" = {
* ...
* "delete-multiple-confirm" = "Drupal\Core\Entity\Form\DeleteMultipleForm"
* ...
* },
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* },
* ...
* links = {
* ...
* "delete-multiple-form" = "/entity_test_rev/delete_multiple",
* }
* )
*/
Impacts:
Module developers