Steps to replicate:
- On the uc_order views config, enable Use AJAX.
- Go to order page provided by view and enter an order number, then Apply.

Expected behavior is to redirect on order page but, in fact, a modal window is displayed and complains that AJAX encountered an error and the error message is in fact the order page.

Solutions: Use ctools_ajax_command_redirect on views that use AJAX.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SilviuChingaru’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1.6 KB
TR’s picture

Isn't that a known limitation of using the Views Ajax setting?

If set, this view will use an AJAX mechanism for paging, table sorting and exposed filters. This means the entire page will not refresh. It is not recommended that you use this if this view is the main content of the page as it will prevent deep linking to specific pages

(emphasis added)
So Views is recommending not to turn on that setting for this page.

It seems to me that the first hunk in your patch could be put in views_exposed_form() instead of our form_alter, while the second hunk could be put in views_exposed_form_submit() instead of our add-on submit function. Then it would solve the problem for *all* forms trying to use the Ajax setting under these conditions? Or does the code in your patch interfere with some normal Views operations when Ajax is off, and that's why the patch code isn't in there to begin with?

SilviuChingaru’s picture

I opened an issue about this and posted a patch also on Views Issue list: #2531708: Views exposed form redirect on $form_state['redirect'] not working when using AJAX

siva_drupal’s picture

I tested the above issue, the issue is reproducible and also the patch#1 also working fine for that issue.

TR’s picture

@siva_drupal: If you could test out and comment on #2531708: Views exposed form redirect on $form_state['redirect'] not working when using AJAX (mentioned in #3) that would help, because this really should be fixed in Views if possible.