fix(format-spec): use the link references ResolveRedirect accepts - #44
Conversation
The spec advertised `statamic://entry/<uuid>`, which nothing in Statamic resolves. ResolveRedirect — the resolver behind the link fieldtype — understands `entry::<id>`, `asset::<container>::<path>`, `@child` and a plain URL. The `statamic://` scheme belongs to Bard link marks and image nodes, which go through Bard\LinkMark instead. Link defines no process(), so a value following the old spec is stored verbatim and renders a dead link with no error at write time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Reviewed and approved on the substance — this just needs a rebase on Five of the batch landed (#50, #49, #46, #51, #47), and #50 also appended to I checked every claim in the new spec against
One thing you might consider as a follow-up, not for this PR: the two handles are hardcoded in the spec, but |
Description
The
linkspec advertisesstatamic://entry/<uuid>. Nothing in Statamic resolves that.Statamic\Routing\ResolveRedirect, which backs the link fieldtype, understands exactly four forms:entry::<id>,asset::<container>::<path>,@child, and a plain URL passed through untouched.Type of Change
Related Issue
None — found following the spec when writing a button link, which stored a value no route ever resolves.
Testing
composer test)composer quality)tests/Unit/FieldFormatSpecTest.php— 2 cases. Verified againstmain: both fail there, both pass here. Full suite 1108 tests / 5612 assertions.Environment
Checklist
Notes
statamic://is Bard syntax — link marks and image nodes go throughBard\LinkMark— and even there the form isstatamic://entry::<id>, notstatamic://entry/<uuid>.Linkdefines noprocess(), so a value following the old spec is stored verbatim: no error at write time, and nothing visibly wrong in the CP field until someone clicks the link. The trap is now named incommon_mistakes.