Downloading a multi-day event without a date param returns an .ics missing every field except the title and times — no LOCATION, no URL, no DESCRIPTION, no GEO.
MultiDayEvent::toICalendarEvents() maps each day through Day::toICalendarEvent(), which only sets UID, DTSTART and DTEND. The single-date route (toICalendarEvent()) decorates properly, which is why this has gone unnoticed.
Underlying cause is duplication: the address/coordinates/description/url block is copy-pasted in three places — Event.php:116-130, MultiDayEvent.php:67-81, RecurringEvent.php:36-50 — and simply missing from the fourth path.
Fix
Add protected function decorate(ICalendarEvent $iCalEvent): ICalendarEvent to the base Event holding that block, and call it from all four sites. Day stays ignorant of location — it's about dates and times — so MultiDayEvent decorates what Day returns. Removing the duplication and fixing the bug is the same edit.
While in there, guard coordinates before it reaches spatie's coordinates(float $lat, float $lng). A partial or non-numeric value is a TypeError, i.e. a 500 on a public download route — the same crash class as #184.
Tests
TDD — write these failing first. In tests/Http/Contollers/IcsControllerTest.php:
- multi-day event downloaded with no
date param emits LOCATION:, URL:, DESCRIPTION: and GEO: on every day
- the three already-working routes still emit them (regression guard against the refactor)
coordinates missing longitude doesn't fatal, and emits no GEO:
coordinates with non-numeric values doesn't fatal
Docs
No user-facing contract change, so nothing beyond whatever the field table says after #191.
Branch
fix/multi-day-ics-missing-fields off 6.x, then forward-merge to main — later steps build on decorate().
Part of #190.
Downloading a multi-day event without a
dateparam returns an.icsmissing every field except the title and times — noLOCATION, noURL, noDESCRIPTION, noGEO.MultiDayEvent::toICalendarEvents()maps each day throughDay::toICalendarEvent(), which only sets UID, DTSTART and DTEND. The single-date route (toICalendarEvent()) decorates properly, which is why this has gone unnoticed.Underlying cause is duplication: the address/coordinates/description/url block is copy-pasted in three places —
Event.php:116-130,MultiDayEvent.php:67-81,RecurringEvent.php:36-50— and simply missing from the fourth path.Fix
Add
protected function decorate(ICalendarEvent $iCalEvent): ICalendarEventto the baseEventholding that block, and call it from all four sites.Daystays ignorant of location — it's about dates and times — soMultiDayEventdecorates whatDayreturns. Removing the duplication and fixing the bug is the same edit.While in there, guard
coordinatesbefore it reaches spatie'scoordinates(float $lat, float $lng). A partial or non-numeric value is a TypeError, i.e. a 500 on a public download route — the same crash class as #184.Tests
TDD — write these failing first. In
tests/Http/Contollers/IcsControllerTest.php:dateparam emitsLOCATION:,URL:,DESCRIPTION:andGEO:on every daycoordinatesmissinglongitudedoesn't fatal, and emits noGEO:coordinateswith non-numeric values doesn't fatalDocs
No user-facing contract change, so nothing beyond whatever the field table says after #191.
Branch
fix/multi-day-ics-missing-fieldsoff6.x, then forward-merge tomain— later steps build ondecorate().Part of #190.