Nombre de archivo ICS indefinido

:information_source: Overview

When clicking “Add to calendar” in the event preview modal (the one that appears after clicking on the event’s date), the downloaded .ics file is named undefined.ics and the event title inside the calendar file is also set to SUMMARY:undefined. However, downloading the calendar via the “Add to calendar” option from the event’s 3-dot menu works as expected, using the event’s title for both the filename and the calendar summary.

:walking_woman: Steps to reproduce

  1. Create or open a topic with an event

  2. Click on the event date shown in the post to expand the preview modal:

  3. In the modal, click on Add to calendar

  4. Save the generated .ics file.

  5. Optionally, compare by clicking on the event’s 3-dot menu and using Add to calendar from there

:white_check_mark: Expected results

  • The downloaded .ics file should be named after the event’s title
  • The calendar file content should have a correct SUMMARY: with the event title

:x: Observed results

  • The downloaded file is named undefined.ics
  • The event title in the calendar file is SUMMARY:undefined
  • (When downloaded from the 3-dot menu, both filename and summary are correct.)

:books: Additional context

  • Example of malformed ICS content:
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//Discourse//EN
    BEGIN:VEVENT
    UID:1762794000000_1762801200000
    DTSTAMP:20251105T173754Z
    DTSTART:20251110T170000Z
    DTEND:20251110T190000Z
    SUMMARY:undefined
    END:VEVENT
    END:VCALENDAR
    

Tested on Meta and several other Discourse sites, same result.