Skip to content

Commit e07e762

Browse files
committed
Add statement to 'beforeSave' method to allow app:config:import
1 parent b2eb795 commit e07e762

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

+7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ public function __construct(
6666
public function beforeSave()
6767
{
6868
$value = $this->getValue();
69+
if (!is_array($value)) {
70+
try {
71+
$value = $this->serializer->unserialize($value);
72+
} catch (\InvalidArgumentException $e) {
73+
$value = [];
74+
}
75+
}
6976
$result = [];
7077
foreach ($value as $data) {
7178
if (empty($data['country_id']) || empty($data['cc_types'])) {

0 commit comments

Comments
 (0)