Skip to content

Commit

Permalink
added message log for ps_accounts install fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
mandan2 committed Oct 10, 2023
1 parent 0cc4fb1 commit b34bb3b
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions controllers/admin/AdminMollieSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,6 @@ public function postProcess()

private function displayModuleSettings(): string
{
Media::addJsDef([
'description_message' => addslashes($this->module->l('Enter a description')),
'min_amount_message' => addslashes($this->l('You have entered incorrect min amount')),
'max_amount_message' => addslashes($this->l('You have entered incorrect max amount')),

'payment_api' => addslashes(Mollie\Config\Config::MOLLIE_PAYMENTS_API),
'ajaxUrl' => addslashes($this->context->link->getAdminLink('AdminMollieAjax')),
]);

/* Custom logo JS vars*/
Media::addJsDef([
'image_size_message' => addslashes($this->module->l('Upload an image %s%x%s1%')),
'not_valid_file_message' => addslashes($this->module->l('Invalid file: %s%')),
]);

/** @var ModuleRepository $moduleRepository */
$moduleRepository = $this->module->getService(ModuleRepository::class);

Expand All @@ -116,6 +101,21 @@ private function displayModuleSettings(): string
return '';
}

Media::addJsDef([
'description_message' => addslashes($this->module->l('Enter a description')),
'min_amount_message' => addslashes($this->l('You have entered incorrect min amount')),
'max_amount_message' => addslashes($this->l('You have entered incorrect max amount')),

'payment_api' => addslashes(Mollie\Config\Config::MOLLIE_PAYMENTS_API),
'ajaxUrl' => addslashes($this->context->link->getAdminLink('AdminMollieAjax')),
]);

/* Custom logo JS vars*/
Media::addJsDef([
'image_size_message' => addslashes($this->module->l('Upload an image %s%x%s1%')),
'not_valid_file_message' => addslashes($this->module->l('Invalid file: %s%')),
]);

/** @var TemplateParserInterface $templateParser */
$templateParser = $this->module->getService(TemplateParserInterface::class);

Expand Down Expand Up @@ -188,6 +188,11 @@ private function setEnvironmentForAccounts(): void
return;
}
} catch (\Throwable $exception) {
$logger->error('"PrestaShop Accounts" install failed.', [
'Exception message' => $exception->getMessage(),
'Exception code' => $exception->getCode(),
]);

$this->context->controller->errors[] =
$this->module->l('Failed to install Prestashop Accounts module. Please contact support.');

Expand Down

0 comments on commit b34bb3b

Please sign in to comment.