Skip to content

Fix: Form Builder: Set subscriber as active when Tag/Sequence set - #1209

Draft
n7studios wants to merge 4 commits into
mainfrom
fix-form-builder
Draft

n7studios wants to merge 4 commits into
mainfrom
fix-form-builder

Conversation

@n7studios

@n7studios n7studios commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes Form Builder blocks with only a Tag and/or Sequence set (no Kit Form) creating subscribers as inactive.

#1084 creates the subscriber as inactive when a Kit Form is specified, so the Form's double opt-in setting is honored, and active otherwise, as there's no double opt-in for Tags or Sequences. However, the block always outputs a hidden form_id field, which is 0 when no Form is selected. The check $form_id !== false was therefore always true, so every subscriber was created as inactive, including those from Tag or Sequence only blocks.

Form, Tag and Sequence IDs are now cast to integers, and the subscriber is only created as inactive when a Form ID is set. This restores the behaviour from before #1084 for Tag and Sequence only blocks, and matches the Contact Form 7, Forminator and WishList Member integrations, which only use inactive for Forms.

The behaviour when a Form is specified is unchanged.

Testing

New Integration tests in BlockFormBuilderTest, mocking Kit API requests:

  • testSubscriberInactiveWhenFormSpecified: the subscriber is created as inactive and added to the Form.
  • testSubscriberActiveWhenTagSpecified: the subscriber is created as active and tagged. Fails on main.
  • testSubscriberActiveWhenSequenceSpecified: the subscriber is created as active and added to the Sequence.
  • PageBlockFormBuilderCest: testFormBuilderBlockWithTaggingEnabled and testFormBuilderBlockWithSequenceEnabled now also assert the subscriber is active.

Checklist

@n7studios n7studios added this to the 3.4.6 milestone Oct 1, 2026
@n7studios n7studios self-assigned this Oct 1, 2026
@n7studios n7studios added the bug label Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios
n7studios marked this pull request as ready for review October 2, 2026 01:57
@n7studios
n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team October 2, 2026 01:57
@n7studios
n7studios marked this pull request as draft October 2, 2026 02:46
This PR now only fixes Tag and Sequence only blocks creating inactive subscribers.
@n7studios n7studios changed the title Fix: Form Builder Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 participant