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

[!!!][TASK] Remove obsolete DeeplPreviewFlagGeneratePageHook #399

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent;
use WebVision\Deepltranslate\Core\Hooks\DeeplPreviewFlagGeneratePageHook;

/**
* Event listener to render the frontend preview flag information.
*
* TYPO3 v12+ only and this is the counter-part of the {@see DeeplPreviewFlagGeneratePageHook} for older TYPO3 versions.
* https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-97862-HooksRelatedToGeneratingPageContentRemoved.html
* @internal for `deepltranslate-core` internal usage and not part of public API.
*/
final class RenderTranslatedFlagInFrontendPreviewMode
{
Expand Down
59 changes: 0 additions & 59 deletions Classes/Hooks/DeeplPreviewFlagGeneratePageHook.php

This file was deleted.

22 changes: 8 additions & 14 deletions Configuration/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\DependencyInjection\SingletonPass;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Dashboard\WidgetRegistry;
use WebVision\Deepltranslate\Core\Client;
use WebVision\Deepltranslate\Core\ClientInterface;
Expand All @@ -35,8 +34,6 @@
use WebVision\Deepltranslate\Core\Widgets\UsageWidget;

return function (ContainerConfigurator $containerConfigurator, ContainerBuilder $containerBuilder) {
$typo3version = new Typo3Version();

$services = $containerConfigurator
->services();
$services->defaults()
Expand Down Expand Up @@ -162,17 +159,14 @@
]
);

if ((new Typo3Version())->getMajorVersion() >= 12) {
// @todo Unnest this in next major when TYPO3 v11 support has been removed.
$services
->set(RenderTranslatedFlagInFrontendPreviewMode::class)
->tag(
'event.listener',
[
'identifier' => 'deepltranslate-core/render-translated-flag-in-frontend-preview-mode',
]
);
}
$services
->set(RenderTranslatedFlagInFrontendPreviewMode::class)
->tag(
'event.listener',
[
'identifier' => 'deepltranslate-core/render-translated-flag-in-frontend-preview-mode',
]
);

/**
* Check if WidgetRegistry is defined, which means that EXT:dashboard is available.
Expand Down
6 changes: 0 additions & 6 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList']['deepl']
= \WebVision\Deepltranslate\Core\Hooks\TCEmainHook::class;

if ($typo3version->getMajorVersion() < 12) {
// @todo Remove when TYPO3 v11 support is removed.
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all']['deepl-1675946132'] =
\WebVision\WvDeepltranslate\Hooks\DeeplPreviewFlagGeneratePageHook::class . '->renderDeeplPreviewFlag';
}

//xclass localizationcontroller for localizeRecords() and process() action
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Backend\Controller\Page\LocalizationController::class] = [
'className' => \WebVision\Deepltranslate\Core\Override\LocalizationController::class,
Expand Down