I have needs for operations on thousands nodes. For example, give a certain workflow_status to my thousands image_nodes. But I get PHP timeout errors for just 200 hundred nodes.
My idea is to implement cron jobs queue support (as an option), so that there will be no more need to get back to the view as long as the job's not finished. Would save hours in our work process.
Job queue offers a job_queue_add() function which "may be used to queue the job to eventually be executed as cron runs and the job_queue module processes the job queue".
Would be great to have this in VBO! And because VBO already offers a best feature of my site, thank you Karim!
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | Image 7.png | 36.34 KB | doc2@drupalfr.org |
| #10 | Image 8.png | 76.8 KB | doc2@drupalfr.org |
| #10 | Image 9.png | 63.23 KB | doc2@drupalfr.org |
| #10 | Image 10.png | 78.2 KB | doc2@drupalfr.org |
| #10 | Image 11.png | 19.22 KB | doc2@drupalfr.org |
Comments
Comment #1
infojunkieWell thanks a lot, I was looking for a module that would do this because I didn't want to implement it myself!
Comment #2
doc2@drupalfr.org commentedDoes it mean that you may implement it within VBO?! I hope Job queue will help you make it easier with its almost ready-to-go function.
8D - Love the hook system!
If yes or maybe, I'd like to know when do you think you could achieve such a feature?
Cheers Captain!
Comment #3
infojunkiePlease try the latest -dev version. It contains support for job_queue.
Comment #4
doc2@drupalfr.org commentedSTEP 1:
drupal.org hasn't updated the tarball from CVS yet (I thought so, but tried anyway)
In the last dev version I used to test:
$Id: views_bulk_operations.module,v 1.29.2.20 2008/10/10 18:35:31 kratib Exp $Version taken from the "Operations" page after the "no operation enabled" error message. See below
- The selected actions for my view worked, but once the actions had been performed with the successful messages, I got on the same page a "No operations are enabled" error message. Indeed, all my actions were removed from my VBO_view (I hadn't checked before performing). I guess that the reason it worked is about some views' cache or so.
- All "taxonomy node operations" were available again, compared to the version I used before.
- Kind of bug: Selecting all (884) nodes from the view with 50 of them exposed per page (Image 1) led to a confirmation page where only the fifty of them were selected (Image 2). Actions were effectively performed on the 50.
Note: I forgot to run upadte.php at this stage.
As we could have expected:
- No "Job type" parameters (from admin/settings/job_queue) were available.
- No jobs were queued (admin/logs/job_queue).
-----------
Important: Until now, I've been using the following dev version (tarball release of September the 6th, 2008):
$Id: views_bulk_operations.module,v 1.29.2.17 2008/09/05 09:52:03 kratib Exp $You commented that it was buggy because:
"settings for bulk ops views are currently stored in the variables table..."
I file you my version of the whole module in a ZIP (.txt for upload grant) in case you couldn't/wouldn't use those from the CVS or your own computer (don't rely on the .info file version), or in case it's less buggy than the current dev release.
-----------
Impatiently looking forward to the tarball release! Best regards.
PS: Next time, I won't forget to run update.php and check the "operations" page of my VBO_view
Comment #5
infojunkieI'm not sure you got the right version. The latest tarball is currently released. Here's what you should notice as changed:
* The "Operations" tab is now called "Settings".
* The version signature at the bottom of the Settings tab is views_bulk_operations.module,v 1.29.2.21.
As for your other inquiries:
* The latest dev should be no more buggy than the earlier version. I think you ran into problems because of the update.php issue.
* Concerning the "Select All" issue, I noticed that in "Image 1.png", the selection message reads "All 50 nodes on this page are selected" which means you probably did not click the "Select all 884 nodes in this view". That would explain why the operations were made on 50 nodes only.
* "Taxonomy node operations" should be picked up by any version because I don't explicitly filter them. However, I advise to use my own "Modify taxonomy" action instead, because it's much more economical in terms of resources.
Waiting for your feedback.
Comment #6
doc2@drupalfr.org commentedYou were probably right. I've just tested your brand new version:
First, please note that we work with:
- Drupal 5.11
- Views 1.6 patched with:
#218187: Views cache too large
#143888: support subqueries #37
- Apache 2.2.8
- MacOS X Darwin
- PHP 5.2.6 - Memory limit 512M
- MySQL 5.0.45
Please let me know anything else you'd need.
So, I deleted the old VBO folder then put the new one and ran update.php + cleared views' cache.
Then, Image 3:
In the next step, Image 4:
The first 9 nodes you see in the Queued jobs logs are Page_nodes, and were not selected in the VBO_view.
In the meanwhile, Image 5:
Afterwards, Image 6: I got three "
Invalid argument supplied for foreach() in views_query.inc" errors:foreach ($view->filter as $i => $filter) {from the "function _views_view_build_filters".foreach ($view->argument as $i => $argument) {from the "function _views_build_query".foreach ($view->sort as $i => $sort) {from the "function _views_view_build_sorts".Note: I've quoted the lines from my views_query.inc file cause I use a patched views.module (with 143888 #37).
Could those error ever be related to nodes that wouldn't have a workflow?
Problems now, Image 6:
FREEZE!
Comment #7
infojunkieImages not attached.
On my side, I have a suspicion that the Select All feature might not be taking in consideration the filter settings :-( I'll check that.
In the meantime, I would suggest trying an unpatched Views. It seems your setup is a bit complex so in order to try a new functionality properly, it would be best to simplify the environment a little.
Comment #8
doc2@drupalfr.org commentedAaaaargh... I thought they were so I deleted them!!
Your suspicion that "the Select All feature might not be taking full consideration the filter settings" has been one of mine too.
End of the day, I'll get back next week. Thank you very much!
Comment #9
infojunkieAfter a couple of tests, it seems "Select All" is working correctly with filters. Unless you can reproduce such a bug on a clean Views + VBO environment, I think the proliferation of nodes in the job queue is caused by something else.
Comment #10
doc2@drupalfr.org commentedI have no idea why such a mess happened.
Today, I've deleted the too numerous jobs by hand in the DB, and I've tried again.
With the same settings, it has worked for a single enqueued node job, and for 17 others. Fearing for further issues, I haven't enqueued bigger jobs yet. But it seems to work correctly now. Indeed, I've even got user messages that I haven't had the first times (Image 10).
Just publishing the image of a succesful VBO Job queue for testers to compare.
Feature request I'm going to post for Job queue: add views integration so that my node won't appear anymore in my view "nodes without workflow status" if they are enqueued... and many more useful uses as well.
Many big thanks for what you've done so quickly Karim!
Comment #11
infojunkieGood to see it's working ! You can open feature requests in other issues.
Comment #12
doc2@drupalfr.org commentedJust an adjustment about this particular feature. This is a very concrete need fed back by my teammates.
My editors would enjoy an option on a "front end" page (such as on the confirmation page "Are you sure you want to perform the Operation..." or even on the main VBO view_page) the possibility to:
- perform now (user message would say: "Please note that this may take a while, depending on the number of node and operation. In case of numerous operation, you should choose to perform background to avoid PHP timeout or server access breakout". This is just an user message example as I probably don't use the correct words and wording).
- perform background (example user message would say: "Please note that the operations will be performed next time the cron [not such an end-user-friendly word] runs. In the meanwhile, you view may not reflect the future update of your nodes. Beware not to queue twice the same job on the same nodes.")
I guess a single checkbox would it. What you could do is add another checkbox in the Setting page to "authorize end user to override this [background] setting" (in a better wording of course!), so that admins may grants end-user or not access to this great option.
I'll be posting the other features request ASAP. Was a pleasure to help testing. BTW, will you commit this?!
Arsène
Comment #13
doc2@drupalfr.org commentedI hope I consistently centralised a few feature requests around mine for the Job_queue.module: #330027: Adding views support - implementation suggestions.. Feedbacks welcome, if one can.