Skip to content

Commit

Permalink
fix: setContainer Ps Account install module
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin-Freoua-Alma committed Oct 1, 2024
1 parent e37cfd0 commit d951d30
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions alma/alma.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ public function install()
{
try {
$this->checkCompatibilityPSModule();
$this->setContainer();
$this->getService('alma.ps_accounts_installer')->install();
} catch (\Alma\PrestaShop\Exceptions\CompatibilityPsAccountException $e) {
\Alma\PrestaShop\Logger::instance()->info($e->getMessage());
Expand Down Expand Up @@ -258,6 +259,14 @@ public function getService($serviceName)
return $this->container->getService($serviceName);
}

public function setContainer()
{
$this->container = new \PrestaShop\ModuleLibServiceContainer\DependencyInjection\ServiceContainer(
$this->name,
$this->getLocalPath()
);
}

/**
* @return bool
*
Expand Down Expand Up @@ -599,10 +608,7 @@ public function getContent()
public function renderPSAccount()
{
$this->checkCompatibilityPSModule();
$this->container = new \PrestaShop\ModuleLibServiceContainer\DependencyInjection\ServiceContainer(
$this->name,
$this->getLocalPath()
);
$this->setContainer();

try {
$accountsFacade = $this->getService('alma.ps_accounts_facade');
Expand Down

0 comments on commit d951d30

Please sign in to comment.