Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In an exposed view with bulk style, when the form is submitted via Ajax, the form action set by VBO is incorrect. This is introduced by http://drupalcode.org/project/views_bulk_operations.git/commitdiff/23d19c4
Example: in a view with two displays: a default display and a page display, if you call $view->get_path()
it returns the path to the page display, not to the current display. Views uses this value as 'view_base_path', and VBO should not use it, instead, use 'view_path' (which is the value of check_plain($_GET['q'])
) as in the old version.
Comment | File | Size | Author |
---|---|---|---|
#8 | vbo-ajax_wrong_action-1416396-8.patch | 617 bytes | bferretti |
#4 | vbo-ajax_wrong_action-1416396-4.patch | 646 bytes | Josh Benner |
Comments
Comment #1
kongoji CreditAttribution: kongoji commentedconfirm the issue: I'm facing this problem when including VBO views in a Quicktabs block.
After every ajax submit of exposed filters, the next vbo operation redirects to the original view's path. It should redirect to the current url, not to the default view url.
Comment #2
kongoji CreditAttribution: kongoji commentedTo make it work, as jcisio suggested, change
view_path
arguments in_views_bulk_operations_add_js
function in views_bulk_operations.module.replace
with
Comment #3
kongoji CreditAttribution: kongoji commentedI fixed my problem with ajax and vbo in a simpler way: #1454582: Views ajax exposed filters break vbo when more than a VBO view is embedded on the same page
Comment #4
Josh Benner CreditAttribution: Josh Benner commentedSolution mentioned in #3 has been committed to 6.x-1.x-dev, but does not fix this issue in all cases.
Solution mentioned in #2 is confirmed to work in my case. Patch attached.
Comment #5
Josh Benner CreditAttribution: Josh Benner commentedI should also note that this affects ajax pagers. This means that if you navigate the pager, then submit, the form action is wrong.
Comment #6
andrewbelcher CreditAttribution: andrewbelcher commentedThis is also an issue 7.x-1.x using a content pane inside a panel.
I solved it for my situation with the following:
I wonder if extracting the view's path from the view is the way to go, as it is there as an argument for the form builder?
Comment #7
shi99 CreditAttribution: shi99 commentedI tried out the patch from #4 and it resolved the issue I had with having an exposed filter and VBO on the same page.
It would be great if it could be committed.
Comment #8
bferretti CreditAttribution: bferretti commentedAlternate solution.
Comment #9
joelpittetClosing this as 6.x is no longer being maintained.