API support for multiple-choice
Brevo has a new attribute type multiple-choice.
Adding this attribute type to Brevo breaks Drupal module using brevo-php and gives this error:
InvalidArgumentException: Invalid value for 'type', must be one of 'text', 'date', 'float', 'id', 'boolean' in /var/www/html/vendor/getbrevo/brevo-php/lib/Model/GetAttributesAttributes.php:373 Stack trace: #0 /var/www/html/vendor/getbrevo/brevo-php/lib/ObjectSerializer.php(316): Brevo\Client\Model\GetAttributesAttributes->setType('multiple-choice')
Came across the same issue when getting the attributes (with getAttributes()).
However, came across an additional issue where there's no support for updating these type of attributes.
See the constructor of Brevo\Client\Model\UpdateAttribute. Here, there's no support for multiCategoryOptions containing an array of strings (as defined by the API docs)
Here is a patch that will allow Drupal's custom fields list to be retrieved correctly, it's meant to be a temporary solution.
To use it in your composer.json add this in the patches section (using cweagans/composer-patches):
"patches": {
"getbrevo/brevo-php": {
"[issues/40] Support for multiple-choice attribute --- avoid breaking sendinblue_api custom fields list": "patches/getbrevo_brevo-php/brevo-php_multiple-choice-support_40.patch"
}
},
"enable-patching": "true",
Hi, the Drupal patch works fine to prevent PHP errors, but the API still does not support creating or updating multiple-choice fields. Is this a planned feature?