Looks I can't bulk delete entity on entity list page.
Can add a operation form on list top, like content management page?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ycshen’s picture

hi,

i create a patch and hope it will help

ycshen’s picture

update patch
using views vbo create a tab in 'admin/structure/entity-type/{$enity_type}/bulk_manage'
it is easy to use this ui

imclean’s picture

Issue summary: View changes

This sounds like a good approach. It might be worth converting all admin pages to views.

See: #1434224: Change entity admin pages to use Views

computerbarry’s picture

Hi

I think I'm having the same problem.
Currently have about 50 entities I would like to delete in my bundle list but when I select them all, there is no group delete button?

Is this patch related?
How can I delete all the selected entries?

Right now, I only have the option to delete each entity one by one which is taking a lot of time.

Any suggestions thanks.

Barry

imclean’s picture

Use views bulk operations and create your own view. That way you can add whatever fields you like.

computerbarry’s picture

Thanks imclean

Not sure how to do this, do you have any information on the setup? And do I need to download the patch?
I'm also writing EFQs which display my entities, not currently using views for the output if that makes any difference?

Barry

imclean’s picture

No need for any patch. Make sure you have Views and VBO installed and enabled. Create a new View of the type of your custom entity and add what fields you'd like.

Make one of the fields a VBO action field (I think it's called).

Adding exposed filters let you list entities based on whatever criteria you'd like then you can mass-delete them as required.

computerbarry’s picture

Cool, just reading up on VBO before I get everything installed, first time I've heard of this.

Create a new View of the type of your custom entity and add what fields you'd like.

Would I need to match the fields in the bundle?

Barry

Jānis Bebrītis’s picture

Well, can we remove the checkboxes from builtin display then? Because i checked them all and there are no action buttons or anything, they are useless.

fmizzell’s picture

Agreed, checkboxes that do nothing is terrible UX. Adding the delete button is probably easy and will make the the checkboxes useful. Hopefully that is what the patch that I have not looked at does.

joelpittet’s picture

Status: Active » Needs review

Let's get some eyes on the patch by setting it to needs review.

joelpittet’s picture

Status: Needs review » Needs work

FYI, this works in #2 but it would be nice if it replaced the existing listing that has the dead checkboxes with this one.

@fmizzell would you be willing to add views and VBO as a dependency? It does make short work of this.

+++ b/modules/eck_bulk_manage/eck_bulk_manage.info
@@ -0,0 +1,12 @@
+files[] = eck_bulk_manage.view_default.inc

This is minor but you don't need to include this file in files[]. Files[] really is just a autoloaderesque thing for classes.

fmizzell’s picture

I have not looked at the code, but would it be possible to make it a soft dependency?: If views and vbo are there, then lets give them the nice table with the integration, otherwise, the simple table without the useless checkboxes.

joelpittet’s picture

Soft dependency sounds good, there seems to be one on views. The only problem I see with the current implementation is that it's creating a new view for each entity type because they each have a base_table. I wonder if that can be abstracted somehow so that one view can represent all eck base_tables?

joelpittet’s picture

Status: Needs work » Needs review
FileSize
17.18 KB
  1. Left that loop of base_tables in.
  2. Moved the default view to eck's views folder.
  3. Wrapped the VBO fields with a module_exists() check.
  4. Removed some of the extra VBO actions because they didn't work or were just extra(can add them back easy enough).
  5. Turned off table_select on the other table.
  6. Changed the view & tab name and url to be a bit more generic.

@todo

  1. Currently doesn't override the bundle entity list but puts a more generic entity list with a bundle filter.
  2. Label could be added or replace the ID column.
  3. The row operations could use a separator.

This can be improved a bunch I'm sure but just trying to push this idea forward a bit.

fortis’s picture

Great, I will try