Closed (fixed)
Project:
Lazy Views
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 May 2026 at 14:05 UTC
Updated:
29 May 2026 at 22:05 UTC
Jump to comment: Most recent
When a view loaded via lazy_views has use_ajax: TRUE on its display, the browser's URL bar is silently rewritten to the site's front page as soon as the view finishes loading.
This was harmless prior to Drupal 11.3 because the views AJAX controller didn't update the browser URL. Drupal 11.3's new SetBrowserUrl command exposed the missing view_path in lazy_views' payload.
Pass the current page path so the controller either resolves to the correct origin URL or skips SetBrowserUrl when the path isn't a valid route.
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 #3
cindytwilliams commentedComment #4
b_sharpe commentedI haven't had a chance to look/test yet, but immediately I wonder if query string or hash matters here? I imagine you want to retain these as well.
Either like:
or maybe:
Comment #5
cindytwilliams commentedComment #6
cindytwilliams commentedHaving just window.location.pathname matches what core's Drupal.Views.ajaxView (in core/modules/views/js/ajax_view.js) sends as view_path, which is the route path only.
Core handles the query string separately. ViewAjaxController reads the AJAX request's query params and reattaches them to $target_url.
Comment #7
cindytwilliams commentedComment #9
b_sharpe commentedGood enough for me, tested and working. Thanks!