Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
After updating to Drupal 9.4 when using views with AJAX history enabled the following error was displayed:
An error occured while attempting to process /views/ajax?type=All&page=2&_wrapper_format=drupal_ajax: Failed to execute 'pushState' on 'History'
Steps to reproduce
- Using Drupal 9.4
- Create a view
- Enable views ajax history & ajax
- Trigger an ajax command such as pagination
- Error is displayed.
Proposed resolution
The issue seems to be because the state contains functions, and these cannot be added successfully pushed to the history, add a clean up script that removes any functions from the state.
Comment | File | Size | Author |
---|---|---|---|
#2 | views_ajax_history-pushstate-failed-3295914-2.patch | 1.6 KB | 3li |
Issue fork views_ajax_history-3295914
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
Comment #2
3liComment #3
PanchukThe patch works well, and should be released ASAP, because this is a critical problem.
Comment #4
BerdirFor some reason I'm only getting this while testing the 9.5 upgrade and not 9.4, but confirmed, the patch works.
Comment #6
amateescu CreditAttribution: amateescu for Tag1 Consulting commentedCommitted to 8.x-1.x, thanks!
Comment #8
phjouIt would be great to create a new release, I just encountered this bug and the patch works great.
Comment #9
Percept CreditAttribution: Percept commentedIt took me a very long time to figure this one out as Firefox gave me a slightly different, less specific, error message (with 0 results in Google):
Error in Firefox:
Error in Chrome:
Hopefully this turns up in google now for those using FF.
Comment #10
mmatsoo CreditAttribution: mmatsoo at Chromatic commentedFWIW - this error appeared last week when we upgraded to 9.5.0. Changing to the 8.x-1.x-dev branch fixed it, but it would be great to have a tagged release to use, as per some earlier comments in this thread.
Comment #13
siliconmeadow CreditAttribution: siliconmeadow as a volunteer commented@mmatsoo & @phjou - what version are you using? I've upgraded to from
8.x-1.6
to8.x-1.17
and the problem went away for me. I've not double-checked, but it implies this patch is in the latest release?Comment #14
luenemann8.x-1.7 was released 20 December 2022, and the fix is in that release. See https://www.drupal.org/project/views_ajax_history/releases/8.x-1.7