From 4548be2986c2b532bc4ede415a44f82784c62455 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Fri, 15 Mar 2024 15:55:56 +0100 Subject: [PATCH] retrieve module settings from settings service instead from outdated configuration --- Application/Controller/Admin/d3ActionWizard.php | 14 +++++++++----- Application/Controller/Admin/d3ExportWizard.php | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Application/Controller/Admin/d3ActionWizard.php b/Application/Controller/Admin/d3ActionWizard.php index 366e635..2769f60 100644 --- a/Application/Controller/Admin/d3ActionWizard.php +++ b/Application/Controller/Admin/d3ActionWizard.php @@ -24,8 +24,10 @@ use D3\DataWizard\Application\Model\Exceptions\TaskException; use D3\ModCfg\Application\Model\d3database; use Doctrine\DBAL\Exception as DBALException; use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController; -use OxidEsales\Eshop\Core\Config; use OxidEsales\Eshop\Core\Registry; +use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory; +use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingService; +use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; @@ -85,7 +87,7 @@ class d3ActionWizard extends AdminDetailsController [ $queryString, $parameters ] = $action->getQuery(); - if ($this->d3GetConfig()->getConfigParam('d3datawizard_debug')) { + if ($this->getSettingsService()->getBoolean('d3datawizard_debug', Constants::OXID_MODULE_ID)) { /** @var DebugException $debug */ $debug = oxNew( DebugException::class, @@ -98,11 +100,13 @@ class d3ActionWizard extends AdminDetailsController } /** - * @return Config + * @return ModuleSettingService + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ - public function d3GetConfig(): Config + public function getSettingsService(): ModuleSettingServiceInterface { - return Registry::getConfig(); + return ContainerFactory::getInstance()->getContainer()->get(ModuleSettingServiceInterface::class); } public function getUserMessages(): ?string diff --git a/Application/Controller/Admin/d3ExportWizard.php b/Application/Controller/Admin/d3ExportWizard.php index 33c6c07..cb56926 100644 --- a/Application/Controller/Admin/d3ExportWizard.php +++ b/Application/Controller/Admin/d3ExportWizard.php @@ -26,11 +26,13 @@ use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException; use Doctrine\DBAL\Driver\Exception; use Doctrine\DBAL\Exception as DBALException; use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController; -use OxidEsales\Eshop\Core\Config; use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException; use OxidEsales\Eshop\Core\Exception\DatabaseErrorException; use OxidEsales\Eshop\Core\Exception\StandardException; use OxidEsales\Eshop\Core\Registry; +use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory; +use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingService; +use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; @@ -100,7 +102,7 @@ class d3ExportWizard extends AdminDetailsController [ $queryString, $parameters ] = $export->getQuery(); - if ($this->d3GetConfig()->getConfigParam('d3datawizard_debug')) { + if ($this->getSettingsService()->getBoolean('d3datawizard_debug', Constants::OXID_MODULE_ID)) { throw oxNew( DebugException::class, d3database::getInstance()->getPreparedStatementQuery($queryString, $parameters) @@ -111,11 +113,13 @@ class d3ExportWizard extends AdminDetailsController } /** - * @return Config + * @return ModuleSettingService + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ - public function d3GetConfig(): Config + public function getSettingsService(): ModuleSettingServiceInterface { - return Registry::getConfig(); + return ContainerFactory::getInstance()->getContainer()->get(ModuleSettingServiceInterface::class); } public function getUserMessages(): ?string