Skip to content

[6.x] Forms 2: Add whereStatus to submission queries - #15636

Merged
jasonvarga merged 5 commits into
forms-2from
forms-2-submission-default-status
Oct 12, 2026
Merged

jasonvarga merged 5 commits into
forms-2from
forms-2-submission-default-status

Conversation

@jasonvarga

Copy link
Copy Markdown
Member

This pull request adds a whereStatus() method to the submission query builder, and uses it to keep partial submissions out of places they were leaking into.

whereStatus() accepts finalized, partial or any. Submissions without a partial key are finalized, so submissions saved before Forms 2 stay finalized.

Like entries, queries return every status unless told otherwise. FormSubmission::query(), Form::submissions() and Form::querySubmissions() include partial submissions, and consumers that only want finalized submissions ask for them explicitly.

Partial submissions were previously included in:

  • The form fieldtype's submission counts.
  • The {{ form:submissions }} tag. It now outputs finalized submissions by default, the same way the collection tag defaults to published entries. Use status:is="partial" or status:is="any" to override it.

Places that already excluded partial submissions (the submission limit, the forms index count, the webhook and email previews), the submission status filter and the partial submission cleanup job now use whereStatus() instead of querying the partial key directly.

Exporting "All submissions" still includes partial submissions. "Filtered submissions" exports what's in the listing, which is finalized submissions by default.

The SubmissionQueryBuilder contract is unchanged, to avoid breaking existing implementations. Custom submission repositories should add a whereStatus() method to their query builder.

jasonvarga and others added 5 commits October 12, 2026 12:00
Supports `any`, `finalized` and `partial`. The submission status filter and the partial cleanup job now use it.

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>
A status condition (e.g. `status:is="partial"` or `status:is="any"`) overrides it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jasonvarga
jasonvarga merged commit 02db098 into forms-2 Oct 12, 2026
62 checks passed
@jasonvarga
jasonvarga deleted the forms-2-submission-default-status branch October 12, 2026 16:19
jasonvarga added a commit that referenced this pull request Oct 12, 2026
Takes #15636's whereStatus(), status filter and tag structure, and adds spam on top: a spam case in whereStatus(), spam clauses in the finalized and partial cases, and spam:* conditions overriding the tag's finalized default. Extends #15636's status tests with spam fixtures instead of keeping duplicate tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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