diff --git a/src/wizards/audience/views/integrations/configure-view.js b/src/wizards/audience/views/integrations/configure-view.js index 00861f9fcd..973b293961 100644 --- a/src/wizards/audience/views/integrations/configure-view.js +++ b/src/wizards/audience/views/integrations/configure-view.js @@ -144,16 +144,21 @@ export const ConfigureView = ( { integrations, loading, pendingChanges, saving, - { ( inboundField.options || [] ).map( optionName => { + { ( inboundField.options || [] ).map( option => { + // Framework injects options as { value, label } objects + // (see class-integration.php:get_settings_config()), but accepts bare strings + // for backward compatibility. + const optionValue = typeof option === 'string' ? option : option.value; + const optionLabel = typeof option === 'string' ? option : option.label || option.value; const currentValue = getFieldValue( inboundField ); const selected = Array.isArray( currentValue ) ? currentValue : []; return ( handleCheckboxListChange( inboundField.key, currentValue, optionName, checked ) } + key={ optionValue } + label={ optionLabel } + checked={ selected.includes( optionValue ) } + onChange={ checked => handleCheckboxListChange( inboundField.key, currentValue, optionValue, checked ) } /> ); } ) }