retrieve module settings from settings service instead from outdated configuration
This commit is contained in:
parent
5476891a88
commit
fe1d7c6fcd
@ -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;
|
||||
|
||||
@ -81,7 +83,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,
|
||||
@ -94,11 +96,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
|
||||
|
@ -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;
|
||||
|
||||
@ -95,7 +97,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)
|
||||
@ -106,11 +108,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
|
||||
|
Loading…
Reference in New Issue
Block a user