Fix fatal TypeError when replaying missed API requests referencing removed form fields - #893
Open
rodrigo-arias wants to merge 1 commit into
Conversation
… custom fields When clear_missed_api_requests() replays a queued submission after the form's fields were edited, the stored field hashes no longer resolve in get_original_fields(), so $custom_field['name'] passes null into the strictly-typed ConstantContact_Client::custom_field_exists(), fataling mid-replay. The queue is never pruned, so every subsequent reconnect crashes the same way. Skip fields that no longer exist on the form instead of fataling.
daveromsey
added a commit
that referenced
this pull request
Aug 18, 2026
Props rodrigo-arias See #893
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a fatal that makes reconnection impossible when
ctct_missed_api_requestscontains submissions queued before a form's fields were edited.Problem
On reconnect,
clear_missed_api_requests()replays the queue throughset_contact_properties(), which re-resolves each custom field against the form's current definitions. Stale field hashes no longer resolve, so$custom_field['name']passesnullinto the strictly-typedcustom_field_exists():Since the fatal happens mid-replay the queue is never pruned, so every reconnect attempt crashes — and
ctct_acquiring_tokenis left stuck at'true'.Steps to reproduce
Fix
Skip fields that no longer exist on the form instead of fataling. Verified on a production site with a 61-entry queue.
Related
Full analysis, including two related issues (per-field
custom_fieldsreset dropping all but the last custom field; all-or-nothing queue persistence losing progress on timeout): https://wordpress.org/support/topic/fatal-typeerror-replaying-missed-api-requests-after-a-forms-fields-were-edited/