Skip to content

Commit 4934a93

Browse files
committed
changed the way json config is handled
1 parent c08dc8b commit 4934a93

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

ps17/controllers/admin/AdminAjaxPrestashopCheckoutController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,11 @@ public function ajaxProcessBatchSaveConfiguration()
360360
$this->validateBatchConfiguration($configuration);
361361

362362
foreach ($configuration as $configurationItem) {
363-
$configurationService->set(pSQL($configurationItem['name']), pSQL($configurationItem['value']));
363+
if (is_array($configurationItem['value'])) {
364+
$configurationService->set($configurationItem['name'], json_encode($configurationItem['value']));
365+
} else {
366+
$configurationService->set(pSQL($configurationItem['name']), pSQL($configurationItem['value']));
367+
}
364368
}
365369

366370
$this->exitWithResponse([

ps8/controllers/admin/AdminAjaxPrestashopCheckoutController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public function ajaxProcessBatchSaveConfiguration()
360360

361361
foreach ($configuration as $configurationItem) {
362362
if (is_array($configurationItem['value'])) {
363-
$this->setConfiguration($configurationItem['name'], json_encode($configurationItem['value']));
363+
$configurationService->set($configurationItem['name'], json_encode($configurationItem['value']));
364364
} else {
365365
$configurationService->set(pSQL($configurationItem['name']), pSQL($configurationItem['value']));
366366
}

ps9/controllers/admin/AdminAjaxPrestashopCheckoutController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,11 @@ public function ajaxProcessBatchSaveConfiguration()
360360
$this->validateBatchConfiguration($configuration);
361361

362362
foreach ($configuration as $configurationItem) {
363-
$configurationService->set(pSQL($configurationItem['name']), pSQL($configurationItem['value']));
363+
if (is_array($configurationItem['value'])) {
364+
$configurationService->set($configurationItem['name'], json_encode($configurationItem['value']));
365+
} else {
366+
$configurationService->set(pSQL($configurationItem['name']), pSQL($configurationItem['value']));
367+
}
364368
}
365369

366370
$this->exitWithResponse([

0 commit comments

Comments
 (0)