Skip to content

Commit

Permalink
Merge pull request #1086 from PrestaShopCorp/fix/upgrade-script-8330
Browse files Browse the repository at this point in the history
Fixing errors in update script 8.X
  • Loading branch information
Matt75 authored Jul 12, 2023
2 parents 445e66b + f98af64 commit fc3579f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions upgrade/upgrade-8.3.3.0.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function upgrade_module_8_3_3_0($module)
foreach (Shop::getShops(false, null, true) as $shopId) {
$currentPosition = isset($maxPositionByShops[(int) $shopId]) ? $maxPositionByShops[(int) $shopId] + 1 : 1;
foreach ($fundingSources as $fundingSource) {
if (!in_array($fundingSource, $availableFundingSourcesByShops[(int) $shopId], true)) {
if (!isset($availableFundingSourcesByShops[(int) $shopId]) || !in_array($fundingSource, $availableFundingSourcesByShops[(int) $shopId], true)) {
$db->insert(
'pscheckout_funding_source',
[
Expand Down Expand Up @@ -233,7 +233,9 @@ function upgrade_module_8_3_3_0($module)
true
);
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage(), 3, $exception->getCode(), Ps_checkout::class, $module->id, false);
PrestaShopLogger::addLog($exception->getMessage(), 3, $exception->getCode(), 'Module', $module->id, false);

return false;
}

// Restore initial PrestaShop shop context
Expand Down

0 comments on commit fc3579f

Please sign in to comment.