From def2aabcad8b4ee7dbb0fe3aaaad714b80d23d7e Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Wed, 15 Dec 2021 08:41:52 +0100 Subject: [PATCH] Fix backend preview rendering for video CE The ContentDataProcessor got a constructor argument. We migrated to proper DI to not care. --- Classes/Backend/PreviewRenderer/Video.php | 10 +++- Configuration/Services.yaml | 3 ++ .../Backend/ContentElements/Video.html | 50 +++++++------------ 3 files changed, 30 insertions(+), 33 deletions(-) diff --git a/Classes/Backend/PreviewRenderer/Video.php b/Classes/Backend/PreviewRenderer/Video.php index fb1b0d1..79158ea 100644 --- a/Classes/Backend/PreviewRenderer/Video.php +++ b/Classes/Backend/PreviewRenderer/Video.php @@ -29,6 +29,14 @@ use TYPO3\CMS\Frontend\DataProcessing\FilesProcessor; class Video extends StandardContentPreviewRenderer { + private ContentDataProcessor $contentDataProcessor; + + public function __construct( + ContentDataProcessor $contentDataProcessor + ) { + $this->contentDataProcessor = $contentDataProcessor; + } + public function renderPageModulePreviewContent(GridColumnItem $item): string { $record = $item->getRecord(); @@ -36,7 +44,7 @@ class Video extends StandardContentPreviewRenderer $contentObjectRenderer = new ContentObjectRenderer(); $contentObjectRenderer->start($record, 'tt_content'); - $record = (new ContentDataProcessor())->process($contentObjectRenderer, [ + $record = $this->contentDataProcessor->process($contentObjectRenderer, [ 'dataProcessing.' => [ '10' => FilesProcessor::class, '10.' => [ diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index c50b087..1a040e3 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -21,6 +21,9 @@ services: DanielSiepmann\DsSite\Frontend\RssFeed\XmlSitemapRenderer: public: true + DanielSiepmann\DsSite\Backend\PreviewRenderer\Video: + public: true + DanielSiepmann\DsSite\Frontend\DataProcessing\CategoriesCounts: public: true arguments: diff --git a/Resources/Private/Templates/Backend/ContentElements/Video.html b/Resources/Private/Templates/Backend/ContentElements/Video.html index ec7d10b..fe7f55a 100644 --- a/Resources/Private/Templates/Backend/ContentElements/Video.html +++ b/Resources/Private/Templates/Backend/ContentElements/Video.html @@ -1,41 +1,27 @@ - - -
- -
-

Video v{video.originalFile.uid}: {video.title}

+ +
+ +
+

+ Video v{video.originalFile.uid}: {video.title}
+ Size: {video.size -> f:format.bytes(decimals: 2)} - - The Video is available on YouTube: https://www.youtube.com/watch?v={video.properties.youtube}. - - - The Video is not available on YouTube - +
+ YouTube: {video.properties.youtube}

{video.description -> f:format.nl2br()}

- -

- - - - - - No poster configured. - - -

-
-
- - + +
+
+