Closed (fixed)
Project:
Views Bulk Operations (VBO)
Version:
6.x-1.x-dev
Component:
Core
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2010 at 14:49 UTC
Updated:
11 Jul 2011 at 13:51 UTC
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
Comment #1
iLLin commentedI 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.
Comment #2
infojunkieThere isn't currently but that's a good idea. I'll add it soon.
Comment #3
thommyboy commentedhi,
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
Comment #4
infojunkieI 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.
Comment #5
thommyboy commentedhi 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
Comment #6
infojunkieThat's a great approach. Marking this as fixed since this is a perfectly legitimate way to do what you want.
Comment #7
thommyboy commentedjust 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...
Comment #9
infojunkieChanging this to a feature request. Just need to call new hook
hook_views_bulk_operations_post_executeat the appropriate place.Comment #10
bojanz commentedVBO now has a hook for this: hook_views_bulk_operations_finish. Implement it and do what you need to do.