Forms 2 compatibility - #612
Draft
duncanmcclean wants to merge 4 commits into
Draft
Conversation
under forms 2, `fromModel()` and `makeModelFromContract()` only round-tripped title, store, email, honeypot and data — silently dropping `fields`, non-email `connections` and `charts` on import and on every save. legacy rows still hydrate correctly: a settings `email` array is converted to an email connection (matching core's `hydrate()`), and rows without `fields` fall back to the legacy blueprint file, which is deleted on save like core. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxmaTX9k5n3QpZVbkchKwF
the `save()` and `delete()` overrides on `Submission` had drifted from core — they never dispatched `SubmissionCreating` and missed the `DeleteTemporaryFiles` dispatch on delete. core has persisted through `FormSubmission::save()` since v5.0, so the model work now lives in `SubmissionRepository` instead. also fixes `SubmissionRepository::save()` refreshing the submission instead of the model. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxmaTX9k5n3QpZVbkchKwF
`ImportForms` already funnels through `makeModelFromContract()`, so it just needed coverage. `ExportForms` now rebuilds file forms with their fields, connections and charts, converting legacy `email` settings on the way out. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxmaTX9k5n3QpZVbkchKwF
duncanmcclean
marked this pull request as draft
August 31, 2026 15:05
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011L28dDrEH5JpkJiuXV9AC5
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 makes the Eloquent Driver compatible with Forms 2 (statamic/cms#15039).
Forms
fieldskey, rather than inside blueprints.emailskey has been replaced by aconnectionskey which also stores configs for other, non-email, integrations (eg. webhooks).chartskey is used to store the chart configuration on the Submissions Summary view (only available when Forms Pro is installed)Without explicit support for these keys, they would be silently dropped on import and on every save. These keys are persisted in the
settingsJSON column. No schema changes are necessary.Backwards compatibility
We've made an effort to preserve backwards compatibility:
emailconfigs will be migrated to connections on the next save.fieldswill fall back to their legacy blueprint and be converted to afieldsarray on the next save.Submissions
The
save()anddelete()overrides on the driver'sSubmissionclass had drifted from core — they never dispatchedSubmissionCreating, and missed Forms 2'sDeleteTemporaryFilesdispatch on delete.Since core has persisted submissions through the repository since v5, this PR removes the overrides and moves the model persistence into
SubmissionRepository::save()/delete(), letting core drive the lifecycle. This PR also fixes a bug whereSubmissionRepository::save()refreshed the submission instead of the model.Commands
The
statamic:eloquent:import-formsandstatamic:eloquent:export-formscommands now round-trip fields, connections and charts, converting legacyemailsettings to an email connection on the way out.