Skip to content

[6.x] Forms 2: Preserve the fake flag when replacing submission data - #16003

Merged
duncanmcclean merged 1 commit into
6.xfrom
fake-submission-cleanup
Nov 26, 2026
Merged

duncanmcclean merged 1 commit into
6.xfrom
fake-submission-cleanup

Conversation

@duncanmcclean

Copy link
Copy Markdown
Member

This pull request fixes an issue where fully replacing a fake submission's data would drop its _fake flag, turning it into a real submission.

This was happening because Submission::data() only carried over _partial, _marked_spam_at and _site when the data was replaced.

This PR fixes it by carrying over _fake too.

This PR also improves the fake submission tests:

  • The CP-only test now has an email connection, so asserting that no email job is dispatched actually proves something.
  • The full pipeline test has been renamed to describe what it checks.
  • Added tests for submissions marked as spam by a FormSubmitted listener, and for the delete action not deleting real submissions.

Amp thread: https://ampcode.com/threads/T-f5d22e52-fd5f-4032-b21e-06a349df56f3

Base automatically changed from forms-2 to 6.x November 24, 2026 17:49
…sion tests

Co-authored-by: Duncan McClean <duncan@duncanmcclean.com>
@jasonvarga
jasonvarga force-pushed the fake-submission-cleanup branch from b44eb8b to 7ba7ad8 Compare November 24, 2026 20:19
@duncanmcclean
duncanmcclean merged commit c5dd925 into 6.x Nov 26, 2026
64 checks passed
@duncanmcclean
duncanmcclean deleted the fake-submission-cleanup branch November 26, 2026 16:09
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.

2 participants