views_exposed_form_cache() has some flaws
* it does not respect $form_state['no_cache'] - OK, this can be easily fixed
* it does not have a reset parameter - no problem per se but this makes userland workarounds for problem below impossible
* it caches by view&display-name which was a good idea when we only had views pages and blocks, but now with panels glory is not appropriate anymore - see example below

example which hit me:
1) create a views panel pane display
2) query it programatically and display the result count
3) show it as panels pane

result:
* in 2) $view->override_path is empty and gets stored in cached exposed form
* in 3) $view->override_path is panel path, but exposed form is taken from request cache
* so every exposed form submission redirects to frontpage

This problem generalizes when a view pane is used more than once in a request.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

geek-merlin’s picture

Title: views_exposed_form_cache() should respect $form['#cache'] » views_exposed_form_cache() should respect $form_state['no_cache']

huh, i've been in last century, but problem persists.

geek-merlin’s picture

here's a trivial D7 patch that i rolled for my project and needs forward-porting.

geek-merlin’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.x-dev
Component: Code » views.module
Status: Active » Needs review
FileSize
970 bytes

Same problem, same cure in 8.x views.

geek-merlin’s picture

Title: views_exposed_form_cache() should respect $form_state['no_cache'] » views_exposed_form_cache() flawed

I found some other bugs in this, updating summary.

geek-merlin’s picture

Status: Needs review » Needs work
geek-merlin’s picture

Issue summary: View changes

Updated issue summary.

geek-merlin’s picture

Title: views_exposed_form_cache() flawed » views_exposed_form_cache() flaw, eg. leads to exposed forms redirecting to frontpage

googlefood

geek-merlin’s picture

This issue for request cache seems to correspond with #1055616: Query arguments should be replaced before generating cache ID for db cache.

The issue over there does refine the cache key. In fact we should use that cache key here also for request level caching.

bcobin’s picture

I tried manually applying the change from #2 on Views 7.3.x-dev with and without the patch from #7 - reset on exposed form still sends user to the front page in all cases.

ATAICT, this makes reset on exposed forms in panels unusable. Yikes!

Is there any workaround I can use? Any at all? Any guidance greatly appreciated... thanks! (Yikes again!)

bcobin’s picture

Issue summary: View changes

improved summary

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Lendude’s picture

Issue summary: View changes
Status: Needs work » Closed (cannot reproduce)

Cleaning up old issues.

views_exposed_form_cache doesn't exist anymore, so this became hard to reproduce. If you feel this is still an issue in D7 or that the problematic code just got moved, feel free to open this back up (and possibly move to the D7 queue).