Sierra Modal Form allows for incorrect BYDAY value

Created on 3 October 2023, 9 months ago

Problem/Motivation

On a site we're using date_recur and the Sierra widget from this module to create events that display onto a custom calendar built with JS using fullcalendar.io (not the Drupal module). We recently ran into an issue where the our calendar was failing to load as it was failing to process the rrule correctly. We were able to narrow the issue down to a few events that had a repeating rule set to weekly, but with no days selected. Here's one of the bad rrule's as an example:

RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=;UNTIL=20231121T020000Z

I don't know the RFC spec entirely, but I believe this is incorrect. The BYDAY directive should have a value if in the RRULE.

I'm also unsure if this affects the other widgets.

Steps to reproduce

  1. Install a empty Drupal site with date_recur and date_recur_modular and enable these modules.
  2. Create a new date range field on a content type
  3. In the form display, update the date range field to use the Sierra widget
  4. Create a new node that has the recurring date field.
  5. For the repeating date, set a valid start an end datetime.
  6. For the repeating rules select "Custom"
  7. For the "Repeat every" field select weekly. Do not select any days of the week. Fill in the "Ends" fieldset with any value and save.
  8. Save the node and look at the field's rrule, note the incorrect setting of "BYDAY" directive.

Proposed resolution

Update the widget to enforce selection of day(s) if the Repeat pattern is set to weekly.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States carsoncho

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

Comments & Activities

Production build 0.69.0 2024