drupal_add_js(array('vbo' => array('url' => $_GET['q'])), 'setting');

This line in the module adds a variable that overrides the action for the form. The path does not run through the url function so purl does not have a chance to modify the path. Even though the form has the correct url when the VBO startup js runs the action is changed to a broken url.

ex. ( 'site01/content' becomes => 'content')

-Richard

Comments

infojunkie’s picture

Issue tags: +r1.11

Thanks for your report. Tagging for next release.

Garrett Albright’s picture

Status: Active » Needs review
StatusFileSize
new1.64 KB

Patch!

It looks like this is already in the 6.x-3.x branch, which I accidentally fetched with CVS and tried to patch initially.

infojunkie’s picture

Re #2: Thanks for the patch. I was somehow thinking of removing the url setting altogether, but if this works for the OP, then great!

aron novak’s picture

Status: Needs review » Needs work

Is it supposed to throw away the query parameters?
For me, it's a bit more robust:

$parts = parse_url($_SERVER['REQUEST_URI']);
    drupal_add_js(array('vbo' => array('url' => url($parts['path'], array('query' => $parts['query'], 'fragment' => $parts['fragment'], 'absolute' => TRUE)))), 'setting');

Cause if i'm at a non-ajax views form, it does not throw away my filtering.

Garrett Albright’s picture

Aron, my patch just replicates what's already there. You may be right, though, in that there may be things we're not including in the URL that we should. Would you care to implement your improvement as a patch? If you're new to submitting patches, this page should be helpful.

aron novak’s picture

Status: Needs work » Needs review
StatusFileSize
new2.31 KB

Patch is attached.

infojunkie’s picture

Version: 6.x-1.9 » 6.x-1.x-dev
Status: Needs review » Fixed

I committed the simpler patch in #2. The patch in #6 broke VBO for installations that are not in the domain root. Anyway, the query parameters are recreated by VBO from the view object directly.

Thanks all!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ryan_courtnage’s picture

Title: VBO does not work with purl and organic groups » VBO does not work with purl and organic groups (Spaces is also affected)

FYI for others who are searching for this:

The patch also fixes a problem where VBO operations will not work when submitted inside of a Space (spaces.module), which uses PURL. Without the patch, submitting a VBO form will result in nothing happening other than the page reloading.

Patch in #2 applies cleanly to 6.x-1.10

artkon’s picture

StatusFileSize
new1.88 KB

Just upgraded to views 3 and bulk operations submit url breaks because its adding the purl of the group twice so http://site.com/g/group_name/node/add/ is wrongfully routed to http://sites.com/g/group_name/g/group_name/node/add/. Solution was to exclude the group's purl if you are in a group space. Patch attached below

artkon’s picture

StatusFileSize
new1.14 KB

Patch updated below.

infojunkie’s picture

Status: Closed (fixed) » Needs work

@artkon: please produce a patch against the latest dev. This code has changed a lot.

FYI, the bug you're trying to solve is related to the interaction between Form API, the drupal_goto() core function, and Spaces module. I am willing to include the fix in VBO because I doubt this bug will ever be fixed in D6.

liquidcms’s picture

just reporting and subscribing..

not quite sure where this is at but i have Views Bulk Operations (VBO) 6.x-1.11 and Atrium (spaces, og, etc) VBO does not work (seems to work; form is there, lists nodes, etc - just doesn't do anything)

liquidcms’s picture

hmm.. actually some things work... i could bulk publish posts; but not set node fields (applied patch in #11 as well)

liquidcms’s picture

but even without patch above; doing an arb php script as vbo action does work; so perhaps juts a cck issue with modify node fields action?

bojanz’s picture

Yes, probably a separate bug in the modify fields action. You'd need to provide the exact behavior and error for this to be debugged.

bojanz’s picture

Status: Needs work » Closed (fixed)

Let's do that in a separate issue. This one has too much history, patches, and unrelated problems.