Problem/Motivation

  1. Create a paged view with an exposed filter.
  2. Go to the last page (page n).
  3. Search for a keyword that will yield results, but not enough to display n pages.
  4. Behold a pager for the exact number of pages available after the search query, but you're still on page n, which is empty.

Proposed resolution

Do not enforce the page number when submitting an exposed filter form.

Remaining tasks

None.

User interface changes

None.

API changes

None.

CommentFileSizeAuthor
#1 views_ajax_history_2427343_1.patch472 bytesXano
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Xano’s picture

Assigned: Xano » Unassigned
Issue summary: View changes
Status: Active » Needs review
FileSize
472 bytes

I'm no JS guru, so it may not be the prettiest code. We basically found out that this is where the Views AJAX request GET parameters are passed through, so we find the right parameter and reset the page number.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @Xano. It should use a comment so future people can sort out what you are doing here but that code looks good in my books, changes the first argument's page object if it exists to 0.

gunwald’s picture

Works for me, thank you! Is this module still maintained?

joelpittet’s picture

Minimally:D

  • joelpittet committed dbb02bf on 7.x-1.x authored by Xano
    Issue #2427343 by Xano, gunwald: Enforced page number causes exposed...
joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

I've committed this as a new co-maintainer. It's still minimally maintained but now with more help;)

Status: Fixed » Closed (fixed)

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

Floris Vedder’s picture

@Xano, works for me
My exposed filters got stuck due to this in combination with views_load_more. Thanx for the fix