Skip to content

Commit 72e02f0

Browse files
author
Stanislav Idolov
authored
ENGCOM-1475: [Backport] Add statement to 'beforeSave' method to allow app:config:import #15066
2 parents d224604 + ba2cbf7 commit 72e02f0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/code/Magento/Braintree/Model/Adminhtml/System/Config/CountryCreditCard.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ public function __construct(
5656
public function beforeSave()
5757
{
5858
$value = $this->getValue();
59+
if (!is_array($value)) {
60+
try {
61+
$value = unserialize($value);
62+
} catch (\InvalidArgumentException $e) {
63+
$value = [];
64+
}
65+
}
5966
$result = [];
6067
foreach ($value as $data) {
6168
if (empty($data['country_id']) || empty($data['cc_types'])) {

0 commit comments

Comments
 (0)