Problem/Motivation
template_preprocess_views_view_summary_unformatted() tries to determine the active link based on the <current> route.
But when using AJAX, the current route is /views/ajax so no active link is set.
Steps to reproduce
- Create a view displaying a summary.
- Enable AJAX on this view.
- Trigger an AJAX request.
- No active link is set.
Proposed resolution
\Drupal::service('path.current')->getPath() seems to get the current path correctly even in AJAX requests.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3360996
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 #3
prudloff commentedComment #4
smustgrave commentedWill need a test case to show the bug.
Comment #6
prudloff commentedRebased and added a test.
Comment #7
prudloff commentedComment #8
smustgrave commentedRemoving tests tag as this shows coverage
Since the actual change is a 1 liner and appears to fix the issue, going to mark.
Comment #9
catchOne comment on the MR.
Comment #10
prudloff commentedComment #11
smustgrave commentedBelieve feedback has been addressed on this one.
Comment #12
alexpottBackported to 11.1.x as a bugfix.
Committed and pushed 42fb139e294 to 11.x and bd08e821d86 to 11.2.x and 335bc707498 to 11.1.x. Thanks!
Comment #16
alexpott