Skip to content

Fix: Form Builder: Subscribe and store entry when Name field removed - #1214

Draft
n7studios wants to merge 2 commits into
fix-form-builder-subscriber-idfrom
fix-form-builder-name-field
Draft

n7studios wants to merge 2 commits into
fix-form-builder-subscriber-idfrom
fix-form-builder-name-field

Conversation

@n7studios

Copy link
Copy Markdown
Contributor

Summary

Fixes a PHP notice, and the form entry not being stored correctly, when the Name field is removed from a Form Builder block.

maybe_subscribe() read $form_data['first_name'] directly when storing form entries. If the Name field was removed from the block, first_name isn't submitted, resulting in an Undefined array key "first_name" PHP notice for each entry stored.

The first name is now read once, falling back to a blank string if the Name field isn't included, and used when creating the subscriber and storing entries.

Testing

New Integration test in BlockFormBuilderTest:

  • testSubscribeWhenNameFieldRemoved: submits the block without a first name, and confirms the subscriber is created without a first name and the entry is stored. Fails without this fix.

BlockFormBuilderTest::submit() now accepts an include_name parameter, to submit the block without the Name field.

Checklist

@n7studios n7studios added this to the 3.4.6 milestone Oct 2, 2026
@n7studios n7studios self-assigned this Oct 2, 2026
@n7studios n7studios added the bug label Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 participant