Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295112

On Ajax-enabled forms with a pager, pager is disappearing on form validation error and on Ajax form reload

$
0
0

Updated: Comment #11

Problem/Motivation

When a form has a pager in it, and an element is Ajax enabled, if the form gets a validation error and/or the form is reloaded out of an Ajax request, the pager is no longer rendered in the returning form.

On validation error, and on Ajax reload, the form is reloaded from the cache, and buildForm is not executed. This leads to the pager theme to be rendered without the underlying $pager_* globals initialised, hence no pager rendered.

Proposed resolution

  1. Store the state of the $pager_* global variables in a $form_state['pagers_state'] entry when caching the form and if at least one pager is initialised.
  2. Restore the state of $pager_* global variables from the $form_state['pagers_state'] cache entry when getting the form from cache and the entry exists.

Remaining tasks

Review patch.

User interface changes

None.

API changes

None.


Viewing all articles
Browse latest Browse all 295112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>