From 66a3605609cff0613bfc7d71167b7ff6ef4b07a7 Mon Sep 17 00:00:00 2001 From: Philipp Kitzberger Date: Fri, 6 Oct 2023 12:28:35 +0200 Subject: [PATCH] FIX: page module dead in offline mode --- Classes/Service/DeeplService.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Classes/Service/DeeplService.php b/Classes/Service/DeeplService.php index 4afa7882..02eab2ef 100644 --- a/Classes/Service/DeeplService.php +++ b/Classes/Service/DeeplService.php @@ -55,8 +55,12 @@ public function __construct( $objectManager = GeneralUtility::makeInstance(ObjectManager::class); $this->deeplSettingsRepository = $objectManager->get(SettingsRepository::class); - $this->loadSupportedLanguages(); - $this->apiSupportedLanguages['target'] = $this->deeplSettingsRepository->getSupportedLanguages($this->apiSupportedLanguages['target']); + $config = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['wv_deepltranslate']; + + if ($config['apiKey'] && $config['apiUrl']) { + $this->loadSupportedLanguages(); + $this->apiSupportedLanguages['target'] = $this->deeplSettingsRepository->getSupportedLanguages($this->apiSupportedLanguages['target']); + } } /**