From d084ccdb2666ac3293db1806747a42e6ff464f2a Mon Sep 17 00:00:00 2001 From: Alexander Stehlik Date: Tue, 15 Oct 2024 23:18:45 +0200 Subject: [PATCH] [TASK] Update for TYPO3 13.4 LTS --- Classes/Controller/OembedController.php | 2 +- .../Panopto/PanoptoRequestHandler.php | 19 +++++++++---------- .../EmbedResponsivePaddingViewHelper.php | 8 -------- composer.json | 5 ++--- ext_emconf.php | 4 ++-- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/Classes/Controller/OembedController.php b/Classes/Controller/OembedController.php index 3cdbc8b..97a36a4 100644 --- a/Classes/Controller/OembedController.php +++ b/Classes/Controller/OembedController.php @@ -127,7 +127,7 @@ private function getNextMatchingProvider(ProviderResolver $providerResolver, str { try { return $providerResolver->getNextMatchingProvider($url); - } catch (NoMatchingProviderException $e) { + } catch (NoMatchingProviderException) { return null; } } diff --git a/Classes/Request/RequestHandler/Panopto/PanoptoRequestHandler.php b/Classes/Request/RequestHandler/Panopto/PanoptoRequestHandler.php index 134840a..1c5de04 100644 --- a/Classes/Request/RequestHandler/Panopto/PanoptoRequestHandler.php +++ b/Classes/Request/RequestHandler/Panopto/PanoptoRequestHandler.php @@ -8,21 +8,20 @@ use Sto\Mediaoembed\Domain\Model\Provider; use Sto\Mediaoembed\Request\RequestHandler\RequestHandlerInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Fluid\View\StandaloneView; +use TYPO3\CMS\Core\View\ViewFactoryData; +use TYPO3\CMS\Core\View\ViewFactoryInterface; -final class PanoptoRequestHandler implements RequestHandlerInterface +final readonly class PanoptoRequestHandler implements RequestHandlerInterface { - private PanoptoUrlProcessor $urlProcessor; - - public function __construct(PanoptoUrlProcessor $urlProcessor) - { - $this->urlProcessor = $urlProcessor; - } + public function __construct( + private PanoptoUrlProcessor $urlProcessor, + private ViewFactoryInterface $viewFactory, + ) {} public function handle(Provider $provider, Configuration $configuration): array { - $view = new StandaloneView(); - $view->setTemplatePathAndFilename($this->getTemplatePath()); + $viewFactoryData = new ViewFactoryData(templatePathAndFilename: $this->getTemplatePath()); + $view = $this->viewFactory->create($viewFactoryData); $settings = $provider->getRequestHandlerSettings(); diff --git a/Classes/ViewHelpers/EmbedResponsivePaddingViewHelper.php b/Classes/ViewHelpers/EmbedResponsivePaddingViewHelper.php index b9b99eb..eb8b2f6 100644 --- a/Classes/ViewHelpers/EmbedResponsivePaddingViewHelper.php +++ b/Classes/ViewHelpers/EmbedResponsivePaddingViewHelper.php @@ -17,14 +17,6 @@ public function initializeArguments(): void $this->registerArgument('configuration', Configuration::class, '', true); $this->registerArgument('response', AspectRatioAwareResponseInterface::class, '', true); $this->registerArgument('style-property', 'string', '', false, 'padding-top'); - - $this->registerTagAttribute( - 'class', - 'string', - 'CSS class(es) for this element', - false, - 'tx-mediaoembed-embed-responsive-padding', - ); } public function render(): string diff --git a/composer.json b/composer.json index 8dfe603..02ace50 100644 --- a/composer.json +++ b/composer.json @@ -12,14 +12,13 @@ "require": { "php": "^8.2", "ext-dom": "*", - "typo3/cms-core": "~13.2.1" + "typo3/cms-core": "~13.4.0" }, "require-dev": { "de-swebhosting/typo3-extension-buildtools": "dev-TYPO3_13", "typo3/cms-filelist": "*", "typo3/cms-fluid-styled-content": "*", - "typo3/cms-install": "*", - "typo3/testing-framework": "dev-main" + "typo3/cms-install": "*" }, "replace": { "typo3-ter/mediaoembed": "self.version" diff --git a/ext_emconf.php b/ext_emconf.php index aac6c1c..9f78fcc 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -9,7 +9,7 @@ 'description' => 'External media (YouTube, Flickr, ...) content elements using the http://oembed.com/ standard.', 'category' => 'fe', 'constraints' => [ - 'depends' => ['typo3' => '13.2.1-13.2.99'], + 'depends' => ['typo3' => '13.4.0-13.4.99'], 'conflicts' => [], 'suggests' => [], ], @@ -21,5 +21,5 @@ 'author' => 'Alexander Stehlik', 'author_email' => 'alexander.stehlik.deleteme@gmail.com', 'author_company' => '', - 'version' => '13.0.0-dev', + 'version' => '13.4.0-dev', ];