Skip to content

Normalize boolean CRM fields to standardized values#189

Open
davidperezgar wants to merge 3 commits intotrunkfrom
claude/fix-gdpr-contactform7-PiUBz
Open

Normalize boolean CRM fields to standardized values#189
davidperezgar wants to merge 3 commits intotrunkfrom
claude/fix-gdpr-contactform7-PiUBz

Conversation

@davidperezgar
Copy link
Copy Markdown
Contributor

@davidperezgar davidperezgar commented May 4, 2026

Summary

This PR normalizes boolean CRM fields (gdpr_accept and disclaimer) 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

  • Added normalization logic in get_merge_vars() to convert boolean CRM field values to standardized format
  • Boolean fields (gdpr_accept, disclaimer) are now normalized to '1' (truthy) or '' (falsy) instead of preserving the original checkbox label text
  • Updated corresponding test to expect the normalized '1' value instead of the localized checkbox label

Implementation 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.

claude and others added 3 commits May 4, 2026 10:24
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
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