You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Second half of #190, and the breaking change that cuts 7.0.
location becomes a declared text field holding a place — either a plain description ("Outside the side exit") or an address ("123 Main St, Surrey, BC"). RFC 5545 LOCATION is free text, so both are the same shape and one field covers them. location is also what RFC 5545, the Google Calendar API, MS Graph and schema.org all call it, which is why address goes away rather than the other way round.
Warning
Blocked on transformstudios/prime#834. Statamic's Fields::resolveFields() does ->keyBy->handle(), so duplicate handles collapse silently, last import wins. Today Events declares no location and Prime owns the handle uncontested. The moment this lands, any blueprint importing both prime::location and events::event has two location fields and one loses its data.
Field
resources/fieldsets/event.yaml, in the Location section from #193:
location — type: text, localizable: true, instructions covering both the plain-description and address cases
localizable: true because the text needs translating, unlike the shared online_url.
Resolution
src/Types/Event.php:
icsLocation() → location, falling back to online_url when location is empty
delete icsAddress() and eventUrl(), the address handle, and the Str::isUrl sniff from icsUrl() — icsUrl() becomes just online_url
read via $this->event->get() throughout, rather than today's mix of raw get() and augmented __get
keep an is_string() guard on location: a blueprint can always override the field type, and a TypeError on a public route is the worst failure mode. A non-string value is ignored silently, never fatal, and the addon never reaches into nested shapes — computed values stay the documented escape hatch for custom shapes.
Mapping
Event
LOCATION:
URL:
Physical only
location
—
Online only
online_url
online_url
Hybrid
location
online_url
The fallback row is the point of the whole design: it's what makes an online-only event's join link clickable in Apple Calendar and auto-detected by Fantastical, with no vendor-specific properties.
Tests
TDD — write these failing first.
each row of the mapping table, across all four download routes
non-string location is ignored rather than fatal — collapse Only pass string addresses to ICS downloads #184's three near-identical group-location tests (lines 200, 257, 283) into this one invariant, which is what they were really asserting
address is no longer read
link is no longer read
a URL in location is treated as a location, not a URL — the sniff is gone
Second half of #190, and the breaking change that cuts 7.0.
locationbecomes a declared text field holding a place — either a plain description ("Outside the side exit") or an address ("123 Main St, Surrey, BC"). RFC 5545LOCATIONis free text, so both are the same shape and one field covers them.locationis also what RFC 5545, the Google Calendar API, MS Graph and schema.org all call it, which is whyaddressgoes away rather than the other way round.Warning
Blocked on transformstudios/prime#834. Statamic's
Fields::resolveFields()does->keyBy->handle(), so duplicate handles collapse silently, last import wins. Today Events declares nolocationand Prime owns the handle uncontested. The moment this lands, any blueprint importing bothprime::locationandevents::eventhas twolocationfields and one loses its data.Field
resources/fieldsets/event.yaml, in the Location section from #193:location—type: text,localizable: true, instructions covering both the plain-description and address caseslocalizable: truebecause the text needs translating, unlike the sharedonline_url.Resolution
src/Types/Event.php:icsLocation()→location, falling back toonline_urlwhenlocationis emptyicsAddress()andeventUrl(), theaddresshandle, and theStr::isUrlsniff fromicsUrl()—icsUrl()becomes justonline_url$this->event->get()throughout, rather than today's mix of rawget()and augmented__getis_string()guard onlocation: a blueprint can always override the field type, and a TypeError on a public route is the worst failure mode. A non-string value is ignored silently, never fatal, and the addon never reaches into nested shapes — computed values stay the documented escape hatch for custom shapes.Mapping
LOCATION:URL:locationonline_urlonline_urllocationonline_urlThe fallback row is the point of the whole design: it's what makes an online-only event's join link clickable in Apple Calendar and auto-detected by Fantastical, with no vendor-specific properties.
Tests
TDD — write these failing first.
locationis ignored rather than fatal — collapse Only pass string addresses to ICS downloads #184's three near-identical group-location tests (lines 200, 257, 283) into this one invariant, which is what they were really assertingaddressis no longer readlinkis no longer readlocationis treated as a location, not a URL — the sniff is goneDocs
locationandonline_urlare independent and combinableaddressandlinklocationis skipped, and point at computed values for custom shapesBranch
feature/location-fieldoffmain. Needs #193.Part of #190.