Repository navigation
[6.x] Forms 2 - #15039
Draft
jasonvarga wants to merge 1030 commits into
Draft
[6.x] Forms 2#15039jasonvarga wants to merge 1030 commits into
jasonvarga wants to merge 1030 commits into
Conversation
…ype. The builder wraps it in Fallback, but was sending fieldtype: "fallback" back on save. The repository can't look up "fallback" as a real type, so validation blows up.
…ding, paragraph) had their own collapsed markup that skipped the shared compressed-view structure.
…nge and the category feels pretty different to choice
This reverts commit 237570d.
…m fieldtype. The builder wraps it in Fallback, but was sending fieldtype: "fallback" back on save. The repository can't look up "fallback" as a real type, so validation blows up." This reverts commit 1e759d5.
I think these changes were probably causing the issues we just reverted the fixes for.
Looks like a workaround to something. Will review this shortly to see what the "real" fix should be.
It was causing an issue we tried to fix accross multiple commits where the config array was that for the source fieldtype and not that of the form fieldtype.
- We don't need the `SingleAsset` fieldtype. We can use the Assets fieldtype directly. - Don't need to define a replicator preview. This field won't be used inside replicators. - Moved normalization & preload logic into the underlying fieldtype. - Removed unnecessary normalization in the Vue component. We already handle it in PHP. - Moved the "is this a string or array" logic to the PHP side from the Vue component, like we do in other fieldtypes. - Imported `Icon` component rather than relying on global component registration. - Added additional tests
- Adjust font weight of scale options - Remove scale_values from field config. It isn't being used anywhere. - Remove "(Optional)" prefix from field instructions. All the label fields are optional. - Example should only show 0-5 to avoid options from overflowing. - Removed replicator preview. This field won't be used inside replicators. - Simplified selected value / select option logic - Removed fieldtype example test. It was testing that an array equal'd itself.
- don't need to define replicator preview - styles can be inlined. don't need computed property - handle current value / update value logic in template
- don't need replicator preview - options are normalized on the backend - import `DragHandle` component instead of relying on globally imported components - merged tests and removed example test - mirrored options method from `MultiChoice` fieldtype
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
merging 6.x into forms-2 kept the rewritten `Condition.vue` wholesale, which dropped the change from #14593 that stopped excluding fields already used in another condition. the exclusion lived in the shared `Condition` component, so it blocked field conditions, form field logic and page rules alike. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sy7LsNJGjpwE2ZNr8BphpQ
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q49Rea3WHrqiVjZ5azU7FG
…lected site (#15350) Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
The form builder already keeps fieldtype icons separate from field config. Remove the remaining backend filter so manually added icon values are preserved like other custom config keys. Add regression coverage for custom icon values and fieldtypes with an `icon` config field.
# Conflicts: # lang/en/messages.php
Forms 2 deleted the legacy text fieldtype's front-end views without porting the autocomplete attribute to the generic fallback views that now render it. The user blueprint still declares name/email as type text with autocomplete defaults, so those inputs were silently dropping autocomplete on user:profile_form and user:register_form. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Tags that render forms outside of the Forms feature (e.g. `user:register_form`, `user:profile_form`) resolve field views through `RenderableField`, which called the core `Fieldtype::view()` directly when the field has no form field. Forms 2 renamed the core field templates to their Forms 2 equivalents (`text` → `short_answer`, `textarea` → `long_answer`, `select` → `dropdown`, `radio` → `multi_choice`, `integer` → `number`, `assets`/`files` → `upload`) in 97822c7 and 26d37fb, so those fields fell through to the `default` view: textareas became single-line inputs, selects and radios lost their options, and asset fields could no longer upload files. 9da135d added `autocomplete` to the `default` view, which masked this in the register form tests. Rather than restoring the old templates, `RenderableField` now wraps the core fieldtype in the `Fallback` form fieldtype, the same way core fieldtypes are handled inside Forms 2 forms. A published `forms/fields/{core handle}` view still takes precedence, then the equivalent Forms 2 view, then the core fieldtype's own view. Restoring the old templates isn't an option since `FormFieldtype::view()` checks the underlying fieldtype's view first, so a packaged `text` view would override `short_answer`, `email`, `name`, `phone` and `website` in forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Duncan McClean <duncan@duncanmcclean.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Jason Varga <jason@pixelfear.com>
# Conflicts: # lang/en/messages.php # resources/js/components/field-conditions/Condition.vue # resources/js/pages/forms/Show.vue # src/Http/Controllers/CP/Forms/FormsController.php # src/Providers/AppServiceProvider.php # tests/Feature/GraphQL/FormTest.php # tests/StaticCaching/InvalidateTest.php
Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Jay George <contact@jaygeorge.co.uk> Co-authored-by: Jay George <github@jaygeorge.co.uk> Co-authored-by: Jason Varga <jason@pixelfear.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
forms-2 has no Email section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…5637) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Jason Varga <jason@pixelfear.com>
# Conflicts: # resources/js/components/field-conditions/Condition.vue # resources/js/components/fieldtypes/ButtonGroupFieldtype.vue # resources/js/components/ui/Combobox/Combobox.vue # resources/js/components/ui/DragHandle.vue # resources/js/components/ui/Radio/Item.vue # resources/js/components/ui/Textarea.vue
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.
Forms 2 is a complete overhaul of Statamic's forms functionality, including (but certainly not limited to):
sitethey're submitted fromSubmitFormaction to submit forms programmaticallyTest it out
You can test out Forms 2 by using the
forms-2-previewbranch, which will contain the built assets. No need to manually compile anything.Important
This should be considered alpha. Things are highly likely to change. Only use locally for testing.
Forms Pro
Forms Pro is a paid first-party addon adding extra features on top of Core, like multi-page forms, visualisations, an Address fieldtype with autocomplete, and integrations with popular email marketing tools.
Some of these features live in
cms, gated behind whether Forms Pro is installed. It also lifts the single form limit, so you can have more than one form without needing Statamic Pro.Pricing and other details will be announced when everything is released. Hold tight!
Breaking changes
Because Forms 2.0 is being released in a minor release, we've done our best to avoid breaking changes, migrating what we can to new formats automatically:
emailconfigs are converted into email connections.$form->blueprint()still works. It's now generated using the form's fields.The
configure form fieldspermission has been removed in favour of finer grained permissions. However, it's still supported for roles currently using it.Documentation: statamic/docs#1957
Eloquent Driver: statamic/eloquent-driver#612