Closed (fixed)
Project:
Views Bulk Operations (VBO)
Version:
7.x-3.x-dev
Component:
Core
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2011 at 19:24 UTC
Updated:
2 Jun 2012 at 23:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
bojanz commentedSure, why not.
Comment #2
mradcliffeI was looking at either drupal_get_form, drupal_build_form, or drupal_rebuild_form. I ended up trying to work with drupal_build_form, but I lost the operation value on submit. I might need to analyze and change $form_state a bit more. Also tried working on a test file/module using admin_content default vbo view.
It probably isn't worth posting what I have, but I will in case anyone else wants to work on it.
Comment #3
bojanz commentedYeah, that is definitely a bad idea.
So, we either document that in order to modify a VBO form you need to do:
Or maybe add a hook_views_bulk_operations_form_alter().
Thoughts?
Comment #4
mradcliffeSorry for not replying, bojanz. This thread slipped my memory. I think that's suitable documentation for now, but maybe in 6 months we can look at doing hook_views_bulk_operations_form_alter().
Another quirk. If you do funky things like disabling checkboxes, it really confuses VBO and actions. Although I think that's more related to the js stuff. :-)
Edit: What's the plan for the book structure at http://drupal.org/node/335694? I'll start documenting there with a bit of guidance.
Comment #5
bojanz commentedI can't seem to edit that page for some reason.
Comment #6
tomas.teicher commentedI cannot get it work. How can I edit vbo form in my hook_form_alter?
In particular, I want to edit form in that way, that I would have my custom submit function (with my custom submit button). But I cannot do it because selecting vbo operation in operations fieldset is required.
But I cannot edit the fieldset in form hooks.
Is it possible to achieve this without a patch?
Comment #7
bojanz commentedYou need the code in #3.
You also need to make sure your module runs after views_bulk_operations.
So if views_bulk_operations has a weight of "0", your module needs to have at least the weight of 1.
Weight is a column in the {system} table (though there's probably a contrib module that handles it as well).
Comment #8
tomas.teicher commentedthanks it works OK
Tomas
Comment #9
damiankloip commentedI think add a hook_views_bulk_operations_form_alter hook makes alot of sense. I have done something similar in textformatter now, it makes things alot easier for people altering, and saves a few support queries too :)
@bojanz - Do you want a patch for this?
Comment #10
bojanz commentedYes, please!
Comment #11
damiankloip commentedHere is an initial patch for this, I'm not sure if this covers everything we need right off the bat but should be a good start.
Comment #12
damiankloip commentedWith a newline at the end of the api.php file
Comment #13
bojanz commentedHow about this version?
Comment #14
bojanz commentedCommitted a tweaked version.