Issue with pagination with recurring events and smart date field when AJAX is enabled

Created on 22 September 2023, 9 months ago
Updated 7 February 2024, 5 months ago

Problem/Motivation

The display of recurring events works as expected when viewing the first month of a monthly calendar view. However, if AJAX is enabled and the user clicks on the next month or previous month links, all of the recurring events appear under one date.

When AJAX is disabled, the monthly calendar view works as expected.

** I have tested with a "Bootstrap 5" theme as well as the "Olivero" theme.

The following is a screenshot showing the issue:

Steps to reproduce

  • Create an new "event" content type that contains at least a Smart Date field (multi field)
  • Create an event that is recurring (e.g.: every Monday for the next year)
  • Create a new "events" view displaying the content type "event". Select the format "Calendar by month". Add the smart date field and select the "Smart Date Formatter". Disable the "Display all values in the same row" option for the field. Enable "Use AJAX" for the view.
  • Navigate to the view from the front-end of the site (this is important as the issue does not seem to be present in the Views preview)
  • Notice the events displaying correctly.
  • Navigate to the next month, the recurring events will be listed under one date.

Proposed resolution

If it is simply not possible for AJAX to work correctly with Smart Date fields, perhaps we could add a mention of this in the documentation elaborating how to configure Calendar View for recurring events.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada joelseguin Ontario, Canada

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

Comments & Activities

  • Issue created by @joelseguin
  • Thank you for reporting this issue.

    I think the issue is not related to the Calendar View plugin directly because, as you stated, the issue is present in the Views preview.

    I have just tried to reproduced it with a fresh D10 with the content structure you detailed (node:event + field smart date range unlimited values and recurring events). The View navigation works correctly with and without Ajax.

    I suspect there might be something wrong happening either with the Calendar's timestamp or something in a custom piece of code on your site impacting smart dates' values πŸ€”.

    Could you please try the same view with Ajax navigation but without a regular display such as the unformatted list ?

  • πŸ‡¨πŸ‡¦Canada joelseguin Ontario, Canada

    Sorry about that, I hadn't fully tested on a completely fresh Drupal (10) install. After doing a test on a fresh install AJAX does work as expected. There is likely a module causing an issue on the fairly simple site I'm working on. I'll report back with my findings once I get a chance to do more testing.

  • Status changed to Postponed: needs info 9 months ago
  • No problemo. TY for testing the module.

    Feel free to reope this issue if needed.

  • Status changed to Closed: cannot reproduce 9 months ago
  • πŸ‡¨πŸ‡¦Canada joelseguin Ontario, Canada

    Following a bit of testing I was able to pinpoint the issue.

    It seems as though when using the Viewsreference field β†’ module to display a calendar with ajax, the results do not load as expected when navigating via the months links.

    This can be tested by installing the Viewsreference field, creating a calendar view and enabling ajax. From there, add a Viewsreference field to a content type of choice. Enter content and select the calendar view created. Navigate the calendar (which should contain several recurring events) via the month links.

    At the moment, I've circumvented the problem by using a Block field β†’ instead of a Viewsreference field.

  • Status changed to Active 8 months ago
  • Thank you for testing and for such a level of details.

    I reopen the issue and I'll try to reproduce it ASAP.

  • πŸ‡³πŸ‡¬Nigeria ojchris

    Thanks for bringing this up. I've scratched my head a bit on this for two days. Felt maybe my settings were wrong.

    I have a fresh Drupal 10 installation and the only module is this one. I can confirm that the recurring event is repeated on the current month as shown in the OP. But when I disable AJAX, the event is spread across each month as intended.

Production build 0.69.0 2024