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

Views pagers include ajax metadata

$
0
0

When on a view with an ajax pager, and after at least one ajax load, the links to the next pages will include a bunch of extra metadata related to ajax requests. Specifically ajax_page_state and _wrapper_format are included as query parameters. If you try to load this link, Drupal will return a bunch of JSON instead of rendering the page.

Steps to reproduce:

  1. Install latest Drupal 8.2.x
  2. Create 10 dummy articles
  3. Create a view of content with a page display at /test-ajax-pager
  4. Add a full pager, limit to 2 items shown per page
  5. Under advanced, set Use AJAX to Yes
  6. Go to /test-ajax-pager and click the link for page 2
  7. Copy the link for page 3, and open in a new browser window

Here's an example of what the link looks like /test-ajax-pager?ajax_page_state%5Btheme%5D=bartik&ajax_page_state%5Btheme_token%5D=&ajax_page_state%5Blibraries%5D=bartik%2Fglobal-styling%2Cclassy%2Fbase%2Cclassy%2Fmessages%2Ccontextual%2Fdrupal.contextual-links%2Ccontextual%2Fdrupal.contextual-toolbar%2Ccore%2Fdrupal.active-link%2Ccore%2Fhtml5shiv%2Ccore%2Fnormalize%2Cquickedit%2Fquickedit%2Cshortcut%2Fdrupal.shortcut%2Csystem%2Fbase%2Ctoolbar%2Ftoolbar%2Ctoolbar%2Ftoolbar.escapeAdmin%2Ctour%2Ftour%2Cuser%2Fdrupal.user.icons%2Cviews%2Fviews.ajax%2Cviews%2Fviews.module&_wrapper_format=drupal_ajax&page=2 and here's what it should look like /test-ajax-pager?page=2


Viewing all articles
Browse latest Browse all 294413

Trending Articles



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