Skip to content

Commit ba95edd

Browse files
ENGCOM-1484: [Forwardport] Add statement to 'beforeSave' method to allow app:config:import #15071
- Merge Pull Request #15071 from adrian-martinez-interactiv4/magento2:2.3-develop-PR-port-14829 - Merged commits: 1. 91b72e7
2 parents a53347e + 91b72e7 commit ba95edd

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
@@ -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)