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
- 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.
- 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.