Repository navigation
[6.x] Forms 2: Unique Instances - #15255
Open
duncanmcclean wants to merge 236 commits into
Open
duncanmcclean wants to merge 236 commits into
duncanmcclean wants to merge 236 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…need to use antlers Using Antlers in email address fields is still supported, but this is a slightly easier approach for end-users.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Restrictions were computed from the raw context id while _entry was only rendered when the entry referenced the form. Resolve the submittable entry once and use it for both. With no submittable entry, form-level restrictions apply. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
It re-read and decoded composer.lock on every call, including per-row paths. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ittable entry Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…pdate The connections fieldtype now posts to a dedicated endpoint that validates and processes a connector's config without saving. The connector update endpoint always saves again. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Users who can edit an entry but not the form get no Configure stack, no stored config sent to the client, and keep the entry's stored config on save, at any nesting depth. The stored config lookup is shared with Instance. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tances Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The form fieldtype goes back to storing plain handles and only picks forms to render. An entry is now an instance of a unique instances form only when that form is in the entry's top-level form_instances field, which stores per-entry overrides keyed by form handle. This replaces the FormFieldValues walk, so config lives in one place per entry and form, a save by a user without edit permission keeps that form's own stored config, and stored config survives saves while forms-pro is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Configure and View Submissions now work per row. The form fieldtype component keeps View Submissions and drops Configure, and both share a SubmissionsStack component. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Forms with unique instances get a Collections setting (forms-pro only, shown when Unique Instances is on). Entry blueprints of those collections get a form_instances field, displayed as Forms, injected into the sidebar like date and taxonomy terms, unless the blueprint already defines one. The runtime lookup now reads only the field with the form_instances handle and type, and only counts forms that still target the entry's collection, so removing a collection or turning off unique instances stops existing entries being instances. The picker only offers forms targeting the entry's collection, the fieldtype can no longer be added through the blueprint builder, and the manual placement instructions are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
update() reused the blueprint cached against the published entry, so fieldtypes reading their stored value (like Form Instances keeping config for users who can't edit the form) saw the published data and wiped working copy changes. It now resets the blueprint the way edit() does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A hand-edited string value threw a TypeError on every entry blueprint load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Saving the blueprint wrote the saver's locale into the YAML. The CP translates field displays when rendering, like the injected taxonomy fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Configure and View Submissions were only available for forms selected when the entry loaded, so a newly picked form couldn't be configured until the entry was saved and reopened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e instances forms Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…llection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The form fieldtype goes back to its forms-2 version. The View Submissions button only appeared in certain ui modes. To support it in others, it would require even more changes. This PR is already big enough. Now that there's a top level form instances field, there's already a simple way to view submissions. We can bring back the button in a future PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Submissions, limits, partials, overrides and the CP's View Submissions filters now resolve to the root entry, so every localization of an entry shares one instance. The submission's _site still records where it came from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements "unique instances" for forms: a Forms Pro feature which lets a form be treated as its own instance per entry, with submissions tracked against the entry they were submitted from, rather than in aggregate.
The classic use case is an Events collection where every event has its own RSVP form — each event gets its own submissions, its own capacity and its own close date, all from a single
rsvpform.Like multi-page forms, everything lives in core but is only available when the
statamic/forms-proaddon is installed.Enabling unique instances
Toggle on "Unique Instances" in the form's configure screen, then attach the form to entries using the
formfieldtype.The frontend
When
{{ form:create }}is rendered in an entry's context, it outputs a hidden_entryinput, and the submission is tracked against that entry.Per-entry restrictions & overrides
When unique instances is enabled, the form's Access settings are evaluated per entry:
Connections are overridable in the same way, so each entry can have its own notifications. A warning banner is visible when configuring connections on a form with "unique instances" enabled.
CleanShot.2026-08-24.at.21.42.58.mp4
In the Control Panel
The submissions listing shows which entry each submission came from, and can be filtered down to a single entry.
On the entry's publish form, the form fieldtype has a "View Submissions" option which opens the entry's submissions in a stack, with individual submissions opening in a nested stack. The fieldtype's index view links to the pre-filtered submissions listing, and the submission page links back to the entry.
PHP API
The form fieldtype's value is stored as a plain handle until an entry has overrides, at which point it becomes an array with
formandconfigkeys.Restriction logic lives on a new
Instanceclass, since "is this form open?" becomes a per-entry question when unique instances is enabled:Depends on: