Repository navigation
Fix Brevo multiple-choice attributes receiving a comma-separated string - #3148
Merged
engram-design merged 1 commit intoNov 19, 2026
Merged
engram-design merged 1 commit into
engram-design merged 1 commit into
Conversation
…ng (verbb#3147) Brevo::_convertFieldType() had no entry for the multiple-choice attribute type, so these attributes became string integration fields and a Checkboxes field mapped to one sent "Option A, Option B". Brevo expects an array of strings and ignored the value. Map multiple-choice to IntegrationField::TYPE_ARRAY, so options fields send their values as an array, as they already do for GetResponse and ActiveCampaign.
Member
|
Thanks! |
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 #3147.
Brevo::_convertFieldType()mapsfloat,dateandbooleanand falls back to a string for everything else, so a Brevo attribute of typemultiple-choicebecame a string integration field. A Checkboxes field mapped to it sent"Option A, Option B", and Brevo ignored the value because it expects an array of strings.The fix maps
multiple-choicetoIntegrationField::TYPE_ARRAY.OptionsFieldalready returns its values as an array for array integration fields, which is how the GetResponse and ActiveCampaign checkbox mappings work, so the payload becomes["Option A", "Option B"].Test
tests/Unit/BrevoCustomFieldTypeTest.phpbuilds the custom fields from a Brevo attributes response with amultiple-choice, atextand afloatattribute and checks each type.craft-5: fails,INTERESTSisstringI don't have DDEV on this machine, so I ran the Brevo tests in
tests/Unitwith Pest and a minimal bootstrap (Composer autoload plus the Yii and Craft class files, no Craft app). The new test and the 5 existing tests inBrevoDynamicListAssignmentTest.phppass on PHP 8.5. The only notices are the PHP 8.5 deprecation ofReflectionMethod::setAccessible().