Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix missing configuration object for localization wizard #211

Merged
merged 1 commit into from
May 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Classes/Override/LocalizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Versioning\VersionState;
use WebVision\WvDeepltranslate\Configuration;
use WebVision\WvDeepltranslate\Service\DeeplService;

/**
Expand All @@ -49,12 +50,14 @@ class LocalizationController extends \TYPO3\CMS\Backend\Controller\Page\Localiza
protected DeeplService $deeplService;

protected PageRenderer $pageRenderer;
private Configuration $configuration;

public function __construct()
{
parent::__construct();

$this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$this->configuration = GeneralUtility::makeInstance(Configuration::class);
$this->deeplService = GeneralUtility::makeInstance(DeeplService::class);
$this->pageRenderer->addInlineLanguageLabelFile('EXT:wv_deepltranslate/Resources/Private/Language/locallang.xlf');
}
Expand Down Expand Up @@ -266,7 +269,7 @@ protected function process($params): void
public function checkdeeplSettings(ServerRequestInterface $request)
{
$result = [];
if ($this->deeplService->apiKey != null && $this->deeplService->apiUrl != null) {
if ($this->configuration->getApiKey() != null && $this->configuration->getApiUrl() != null) {
$result['status'] = 'true';
} else {
$result['status'] = 'false';
Expand Down