I'm looking for a way to call a function after the full batch has processed. Basically what I am doing is building an index file to push via ftp to an external server. So I am running an action to build jpg's and adding their names to a "index" file of what I am going to push. 1000+ files and I'm basically moving them to a folder for 'que' and adding their filename to a text file. After the batch runs, ftp the full folder and index file to an ftp server. I could use cron and check for files in a specific folder but would prefer to just do it at the end of the batch.

Any ideas?

Comments

iLLin’s picture

I ended up using cron and scanned the directory then built my index file. But if there is a hook I would still like to know.

infojunkie’s picture

Category: support » feature

There isn't currently but that's a good idea. I'll add it soon.

thommyboy’s picture

hi,
actually that's something we also need in a current project. what we want to do is:
- a special cck field is set to true using bulk operations
- after having finished that, we need to run a script (which will create a new node containing information about ALL the nodes that were changed by the just finished bulk operation

so would the (new) hook make this possible (does it provide information on the affecte nodes) and is there any other way to do what we want in the meantime?
any idea appriciated!
tom

infojunkie’s picture

I will make sure to include this information in the hook. If you are in a hurry and want to go ahead with producing a patch, please do so and I can help out with the implementation on this thread.

thommyboy’s picture

hi infojunkie,
actually we ARE in a hurry ;) but because we don't know the module very well we solved it in another way. we just included our own submit-function in form_alter

if($form_id == 'views_bulk_operations_form__1' & $form_state['storage'] != null)
$form['#submit'][] = 'my_submit';

which does what we want...
Tom

infojunkie’s picture

Category: feature » support
Status: Active » Fixed

That's a great approach. Marking this as fixed since this is a perfectly legitimate way to do what you want.

thommyboy’s picture

Status: Closed (fixed) » Fixed

just one comment for people reading this- take care when you want to modify nodes that are treated by VBO and make sure to use

node_load( nid, null, TRUE ) to disable caching

we had some frustrating experiences that nodes were not changed correctly until we found out it's a caching problem...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

infojunkie’s picture

Category: support » feature
Status: Fixed » Active

Changing this to a feature request. Just need to call new hook hook_views_bulk_operations_post_execute at the appropriate place.

bojanz’s picture

Category: feature » support
Status: Active » Fixed

VBO now has a hook for this: hook_views_bulk_operations_finish. Implement it and do what you need to do.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.