Commit 963e4c67 authored by Oleksiy's avatar Oleksiy Committed by John.Avery
Browse files

Issue #3164764 by Oleksiy, andypost: The module is always using v2 version for...

Issue #3164764 by Oleksiy, andypost: The module is always using v2 version for Salesforce auth token request
parent df01f0d6
......@@ -50,3 +50,19 @@ function marketing_cloud_update_8002() {
->set('marketing_cloud_update_8002', $update_backup);
}
}
/**
* Fix wrong request_token_version setting value.
*/
function marketing_cloud_update_8003() {
$config = \Drupal::service('config.factory')
->getEditable('marketing_cloud.settings');
$requestTokenVersion = $config->get('request_token_version');
if ($requestTokenVersion === '0') {
$config->set('request_token_version', 'v1')->save();
}
if ($requestTokenVersion === '1') {
$config->set('request_token_version', 'v2')->save();
}
}
......@@ -78,8 +78,8 @@ class MarketingCloudSettings extends ConfigFormBase {
'#title' => $this->t('Salesforce auth token request version'),
'#description' => $this->t('The newer version of token request requires different parameters to the legacy v1.'),
'#options' => [
'v1',
'v2',
'v1' => 'v1',
'v2' => 'v2',
],
'#default_value' => $config->get('request_token_version'),
];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment