Skip to content

Commit ba2cbf7

Browse files
ENGCOM-1475: [Backport] Add statement to 'beforeSave' method to allow app:config:import #15066
- Merge Pull Request #15066 from rogyar/magento2:2.1-config-import-country-card - Merged commits: 1. a7e8b71
2 parents ed4b97e + a7e8b71 commit ba2cbf7

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)