Use query string fallback for calendar pager in non-page displays

Created on 10 April 2025, 8 days ago

Problem/Motivation

The Calendar module's pager does not generate correct URLs when used in non-page Views displays, such as blocks. This is because there is no route path to append the pager arguments to, so the current route is used, which may be inappropriate or incorrect.

Steps to reproduce

  1. Create a Calendar view with a block display (not a page display).
  2. Enable pager functionality (e.g., monthly navigation).
  3. Place the block on a page and attempt to use the pager links.
  4. Observe that the links are based on the current route, not on a meaningful calendar route.

Proposed resolution

Update the CalendarPager class to detect when the display has no base path (such as with blocks) and instead build pager links using query string parameters. Use the granularity as the key and append the argument value accordingly (e.g., ?month=2025-04).

Remaining tasks

  • Detect when the view display lacks a base path.
  • Update CalendarPager to generate query string links as a fallback.
📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada joelpittet Vancouver

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024