Normalize boolean CRM fields to standardized values#189
Open
davidperezgar wants to merge 3 commits intotrunkfrom
Open
Normalize boolean CRM fields to standardized values#189davidperezgar wants to merge 3 commits intotrunkfrom
davidperezgar wants to merge 3 commits intotrunkfrom
Conversation
When a CF7 checkbox is used for GDPR consent, the submitted value is the checkbox label text (which can be in any language). Normalizing it to '1' (accepted) or '' (not accepted) at the get_merge_vars() level ensures the value sent to Clientify is always a language-neutral boolean representation, regardless of the CF7 form language. Updates test expectations accordingly. https://claude.ai/code/session_01TysAzoCyRoGPWKKN98e93u
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.
Summary
This PR normalizes boolean CRM fields (
gdpr_acceptanddisclaimer) to use standardized values ('1' for accepted, '' for not accepted) regardless of the checkbox label language used in the Contact Form 7 form.Key Changes
get_merge_vars()to convert boolean CRM field values to standardized formatgdpr_accept,disclaimer) are now normalized to '1' (truthy) or '' (falsy) instead of preserving the original checkbox label textImplementation Details
The normalization is applied after array values are joined but before dynamic value processing. This ensures that regardless of how the checkbox is labeled in different languages or forms, the CRM receives a consistent boolean representation that can be reliably processed downstream.