Skip to content

Commit a31b8b4

Browse files
committed
changed the way json config is handled
1 parent ee9738a commit a31b8b4

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
@@ -361,7 +361,11 @@ public function ajaxProcessBatchSaveConfiguration()
361361
$this->validateBatchConfiguration($configuration);
362362

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

367371
$this->exitWithResponse([

ps8/controllers/admin/AdminAjaxPrestashopCheckoutController.php

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

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

ps9/controllers/admin/AdminAjaxPrestashopCheckoutController.php

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

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

367371
$this->exitWithResponse([

0 commit comments

Comments
 (0)