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.