Skip to content

[6.x] Forms 2: Restore 6.x public API behaviour - #15961

Merged
jasonvarga merged 14 commits into
forms-2from
forms-2-fix-b5-public-api
Nov 19, 2026
Merged

jasonvarga merged 14 commits into
forms-2from
forms-2-fix-b5-public-api

Conversation

@jasonvarga

@jasonvarga jasonvarga commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

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's page and status variables. 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_label and form_previous_page_url.
  • Addon fieldtypes that override extraConfigFieldItems() as protected, and fields that override setForm() 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.
  • Fields added by a FormBlueprintFound listener (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_variables
  • FormCreateTest::it_does_not_shadow_the_pages_and_restriction_variables
  • FormCreateTest::it_does_not_shadow_the_button_and_previous_page_variables
  • FormCreateTest::it_renders_and_submits_fields_added_by_a_form_blueprint_found_listener
  • FieldTest::set_form_can_be_overridden_without_a_return_type
  • FormFieldtypeTest::config_fields_include_extras_from_a_wrapped_fieldtype_overriding_extra_config_field_items_as_protected
  • FormTest::submissions_only_include_finalized_submissions
  • FormTest::deleting_a_form_deletes_partial_and_spam_submissions
  • CsvExporterTest::it_only_exports_finalized_submissions_by_default
  • DeleteFakeSubmissionsActionTest::it_deletes_partial_and_spam_fake_submissions
  • ExportSubmissionsTest::it_only_exports_finalized_submissions_with_the_listings_default_sort
  • ExportSubmissionsTest::it_only_exports_finalized_submissions_when_filtered_without_a_status_filter
  • Updated ExportSubmissionsTest, SubmissionQueryBuilderTest and AccessTest for the new behaviour; tests that inspect spam or partial submissions now use querySubmissions().

🤖 Generated with Claude Code

jasonvarga and others added 14 commits November 18, 2026 14:14
…: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>
@jasonvarga
jasonvarga merged commit 174c35e into forms-2 Nov 19, 2026
61 of 62 checks passed
@jasonvarga
jasonvarga deleted the forms-2-fix-b5-public-api branch November 19, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant