1

There is a custom entity called organisation. I am trying to build a view to allow bulk delete of the entities.

I checked the view for display content and there is a field to display the checkbox(Node operations bulk form).

This field doesn't show up for the custom entity. Enabling the actions module does not help.

Adding a custom action for delete organisation does not help either. The new action shows up on the list of actions, but the "operations bulk form" does not show up on views for the entity.

Thanks in advance for your help

4

You need both an action plugin and an action config entity

  1. Create the plugin with drush: drush generate plugin-action
  2. Create the action config entity: look at "system.action.comment_delete_action.yml" for an example.

After creating these, clear the cache and it should be available in views under the label "Bulk update".

  • I created my action plugin using drush (drush generate plugin-action), then I had to create a config like "system.action.comment_delete_action.yml" – mpp Jul 2 '18 at 15:26
0

It looks like as of 8.6.x, this should be possible by just specifying the delete-multiple-form link template and the delete-multiple-confirm form class for the entity type. For the form class, you can use the generic Drupal\Core\Entity\Form\DeleteMultipleForm.

Not managed to get it to work yet though!

  • Ah, you also need at least one action config entity as well. See Media module for an example of the delete action which uses the derived plugin. – joachim Jan 17 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.