Skip to content

Commit 544b066

Browse files
authored
Merge pull request #5 from magento-tsg-csl3/MC-39050
MC-39050: Magento_ReCaptcha - Unable to serialize value. Error: Malfo…
2 parents b67a37f + bf88a8e commit 544b066

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ReCaptchaMigration/Setup/Patch/Data/MigrateConfigToRecaptchaModules.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,16 @@ private function copyRecaptchaKeys(string $scope): void
115115
{
116116
$type = $this->getActiveRecaptchaType();
117117
if ($type) {
118-
$this->copyRecord(
119-
"msp_securitysuite_recaptcha/general/public_key",
118+
$publicKey = $this->scopeConfig->getValue(
120119
"recaptcha_$scope/type_$type/public_key"
121120
);
121+
$publicKeyLegacy = $this->scopeConfig->getValue(
122+
'msp_securitysuite_recaptcha/general/public_key'
123+
);
124+
if (!$publicKey && $publicKeyLegacy) {
125+
$publicKeyEncrypted = $this->encryptor->encrypt($publicKeyLegacy);
126+
$this->writer->save("recaptcha_$scope/type_$type/public_key", $publicKeyEncrypted);
127+
}
122128
$privateKey = $this->scopeConfig->getValue(
123129
"recaptcha_$scope/type_$type/private_key"
124130
);

0 commit comments

Comments
 (0)