Repository navigation
[6.x] Forms 2: Restore 6.x public API behaviour - #15961
Merged
Merged
Conversation
…:setForm Addon fieldtypes overriding extraConfigFieldItems() as protected, or fields overriding setForm() without a return type, fataled on boot. The form fieldtype bridge now reads extras through a new public getExtraConfigFieldItems() accessor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fields added via ensureField() in a FormBlueprintFound listener have no matching form field, so setFormField() received null and form:create threw a TypeError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…status
They shadowed the cascade's page and status inside the tag pair, so things like {{ page:url }} resolved to the form's current page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6.x never stored spam or partial submissions, so existing callers (including the All Submissions export) now keep seeing finalized submissions only. Deleting a form and deleting fake submissions still remove every status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CP export always sends the listing's sort and order, so it went through the scoped query, which had no status constraint and included spam and partial submissions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drops the new public Fieldtype::getExtraConfigFieldItems(). FormFieldtype doesn't extend Fieldtype, so it calls the protected extraConfigFieldItems() through a closure bound to the wrapped fieldtype. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pages, restricted and restriction_message are now form_pages, form_restricted and form_restriction_message, so they don't shadow cascade variables of the same name inside the tag pair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Form::submissions() now only returns finalized submissions, so assertions meaning "nothing was stored" or "exactly one was stored" would miss stray spam or partial submissions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
button_label, previous_page_label and previous_page_url are now form_button_label, form_previous_page_label and form_previous_page_url, so they don't shadow cascade variables of the same name inside the tag pair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes a few places where forms-2 changed existing 6.x public behaviour, so sites and addons keep working on upgrade.
{{ form:create }}no longer shadows the cascade'spageandstatusvariables. Inside the tag pair,{{ page:url }}and{{ status }}resolve to the current page again. The form-specific variables added in forms-2 are prefixed so they can't collide:form_page,form_pages,form_status,form_restricted,form_restriction_message,form_button_label,form_previous_page_labelandform_previous_page_url.extraConfigFieldItems()asprotected, and fields that overridesetForm()without a return type, no longer cause a fatal error.extraConfigFieldItems()is protected again; the form fieldtype bridge calls it through a closure bound to the wrapped fieldtype, so no new public method is added.FormBlueprintFoundlistener (e.g.$event->blueprint->ensureField(...)) no longer crash{{ form:create }}/{{ form:fields }}. They render and submit like 6.x.Form::submissions()returns finalized submissions only, matching 6.x, which never stored spam or partial submissions. Exports also default to finalized submissions unless a status filter is sent, so the "All Submissions" export no longer includes spam and partials, while an explicit status filter (including spam or partial) still exports those. Deleting a form and the "Delete fake submissions" action still remove submissions of every status.Tests
FormCreateTest::it_does_not_shadow_the_page_and_status_variablesFormCreateTest::it_does_not_shadow_the_pages_and_restriction_variablesFormCreateTest::it_does_not_shadow_the_button_and_previous_page_variablesFormCreateTest::it_renders_and_submits_fields_added_by_a_form_blueprint_found_listenerFieldTest::set_form_can_be_overridden_without_a_return_typeFormFieldtypeTest::config_fields_include_extras_from_a_wrapped_fieldtype_overriding_extra_config_field_items_as_protectedFormTest::submissions_only_include_finalized_submissionsFormTest::deleting_a_form_deletes_partial_and_spam_submissionsCsvExporterTest::it_only_exports_finalized_submissions_by_defaultDeleteFakeSubmissionsActionTest::it_deletes_partial_and_spam_fake_submissionsExportSubmissionsTest::it_only_exports_finalized_submissions_with_the_listings_default_sortExportSubmissionsTest::it_only_exports_finalized_submissions_when_filtered_without_a_status_filterExportSubmissionsTest,SubmissionQueryBuilderTestandAccessTestfor the new behaviour; tests that inspect spam or partial submissions now usequerySubmissions().🤖 Generated with Claude Code