From f9e1c8119406a1f5a08d34422de4b1e009d94508 Mon Sep 17 00:00:00 2001 From: Volker Kemeter Date: Tue, 23 Jan 2024 15:05:22 +0100 Subject: [PATCH] [TASK] added condition to youtube dataprocessor - to check, if reference file is a youtube file. this is needed when using the processor in another element. eg. textmedia --- Classes/DataProcessing/YoutubeProcessor.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Classes/DataProcessing/YoutubeProcessor.php b/Classes/DataProcessing/YoutubeProcessor.php index ce05154..79f04ca 100644 --- a/Classes/DataProcessing/YoutubeProcessor.php +++ b/Classes/DataProcessing/YoutubeProcessor.php @@ -71,11 +71,13 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu $referencesField = $processorConfiguration['referencesField'] ?? 'files'; foreach ($processedData[$referencesField] ?? [] as $reference) { - $videoId = $reference->getContents(); - $video = $this->getVideo($videoId, $reference); + if ($reference->getMimeType() === 'video/youtube') { + $videoId = $reference->getContents(); + $video = $this->getVideo($videoId, $reference); - if ($video) { - $videos[] = $video; + if ($video) { + $videos[] = $video; + } } }