Change record status: 
Project: 
Introduced in branch: 
8.6.x
Introduced in version: 
8.6.0
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.

  1. 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. See Drupal\node\Form\DeleteMultiple
  2. Make sure the Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider is used. If Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider can not be used, define a "entity.my_entity_type.delete_multiple_form" route.
  3. 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