Problem/Motivation

Views pager parameter uses
?page=X
if pager id is = 0

If there are higher pager IDs, views (based on the Symfony routing system) starts creating weird comma-separated URLs which seem to use the MAX pager ID, it looks like this:
?page=0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0

Or encoded:
?page=1%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C0

Steps to reproduce

Use pager id's > 0 on a project when having several pageable views at the same page, e.g. a person contact with lots of information about the person from references
See weird long URLs for all the pagers

Proposed resolution

Instead of this comma syntax use an array syntax for the pager, if pager id > 0, just for the pages != 0
?page[0]=1&page[18]=1
which is

  • much shorter
  • aligning with filters[] syntax
  • allowing to identify the used pagers by ID

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3589900

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

anybody created an issue. See original summary.

anybody’s picture

Title: Use array-syntax for views pager id's != 0 » Use array-syntax instead of list of commas for views pager id's != 0

avinash.jha made their first commit to this issue’s fork.