Hi @306catalyst
Our developers checked it and provided possible solution. It will require adding a small bit of custom code to the site.
This is the code:
<?php
add_filter( 'forminator_custom_form_submit_field_data', 'wpmudev_change_consent_field_val', 10, 2 );
function wpmudev_change_consent_field_val( $field_data_array, $module_id ) {
if ( 2960 !== intval( $module_id ) ) { // Please change the form ID.
return $field_data_array;
}
$submitted_data = wp_list_pluck( $field_data_array, 'value', 'name' );
if ( empty( $submitted_data['consent-1'] ) ) {
$field_data_array[] = array(
'name' => 'consent-1',
'value' => false,
);
}
foreach ( $field_data_array as $key => $value ) {
if ( 'consent-1' === $value['name'] && 'checked' === $value['value'] ) {
$field_data_array[ $key ]['value'] = true;
}
}
return $field_data_array;
}
To add it to the site:
1. create an empty file with a .php extension (e.g. “forminator-salesforce-consent-fix.php”) in the “/wp-content/mu-plugins” folder of your site’s WordPress install on the server
2. copy above code and paste it into that file
3. in the code
a) in this line
if ( 2960 !== intval( $module_id ) ) { // Please change the form ID.
replace number 2960 with an ID of your form; form ID is the same number that you can see in form’s shortcode
b) in this line
if ( 'consent-1' === $value['name'] && 'checked' === $value['value'] ) {
replace consent-1 with your consent field ID if it’s different than consent-1
4. save the file and flush all cache on site.
It should then work automatically out of the box.
Best regards,
Adam