Great Module. I love it.

I'm having an issue with using vbo with views attach via the add/edit node form. The vbo works fine one it's own, but when the submit the node form, it also attempts to submit/validate the vbo form. So I can not submit a node. Bummer.

I could just theme the node form to add the view manually but I think it would be cool to get these modules to work together.

I have an idea of how to fix, just wanted to run it by you before I create a patch.

I was thinking of added a check on $form_state['clicked_button'] in the validate and submit functions. Sound good?

Cheers,
Neil

Comments

infojunkie’s picture

I'm not familiar with Views Attach. I'd like to reproduce your scenario, so can you please give me a step-by-step description of what to do to see the problem?

indytechcook’s picture

Sure,
Views Attach: http://drupal.org/project/views_attach

  1. New Content Type with some CCK field.
  2. Create a view with the content type
  3. Add a pane for "Node Content" (http://img.skitch.com/20091112-br32ii15icaxf2ykr5c76rm374.jpg)
  4. Build mode of "Edit Page" is important
  5. Change the style to Bulk Operations

Views Attach makes the view part of the node form. So the form now has 2 submit buttons, handlers and validation callbacks. When you submit the form, VBO's validation function throws the form_set_error because no operation or rows were selected.

http://img.skitch.com/20091112-tmybwfx16627dedc4wftjtnsmw.jpg
http://img.skitch.com/20091112-8nan2texg4ein512htrgtp232t.jpg

Cheers,
Neil

infojunkie’s picture

Got it and was able to reproduce the problem. I checked on $form_state['clicked_button'] and found that it confuses the VBO "Execute" with the node's "Submit", not sure why.

Anyway, feel free to submit a patch and thanks for your initiative :-)

indytechcook’s picture

Here is is what I have tried so far:

adding an if statement looking for the following on the validation and submit handler for "views_bulk_operations_form"

   if ($form_state['clicked_button']['#prefix'] === '<div id="views-bulk-operations-submit">') {
     .
     .
     .
   }

added the following to each of the submit form elements on views_bulk_operations_form and removed it from the generic form submit hanlder.

   '#submit' => array('views_bulk_operations_form_submit'),
   '#validate' => array('views_bulk_operations_form_validate'),

I event tried changing the name of the elements prefixing them with "vbo." so vbo_submit or vbo_excucute.

No luck yet.

infojunkie’s picture

Status: Active » Postponed

Postponed until someone picks this up. I won't any time soon.

bojanz’s picture

Status: Postponed » Closed (won't fix)

19 months later, it's safe to say this won't be getting attention. And both modules probably changed so many times, who knows what the situation is now.

Reopen if you have a patch to attach.