From 26b982b24006e461bad41ef22135d74a2607aa37 Mon Sep 17 00:00:00 2001 From: 22Alexandra Date: Mon, 7 Oct 2024 08:55:07 +0300 Subject: [PATCH] EWPP-4791: Fix MediaDataExtractor Thumbnail to return a relative URL of a local file. --- .../oe_theme_helper/src/Plugin/MediaDataExtractor/Thumbnail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/oe_theme_helper/src/Plugin/MediaDataExtractor/Thumbnail.php b/modules/oe_theme_helper/src/Plugin/MediaDataExtractor/Thumbnail.php index 6c58ededc..7eb01aa3c 100644 --- a/modules/oe_theme_helper/src/Plugin/MediaDataExtractor/Thumbnail.php +++ b/modules/oe_theme_helper/src/Plugin/MediaDataExtractor/Thumbnail.php @@ -109,7 +109,7 @@ public function getThumbnail(MediaInterface $media): ?ImageValueObjectInterface // Create a new image value object with the new src. $thumbnail = ImageValueObject::fromArray([ - 'src' => $image_style->buildUrl($uri), + 'src' => \Drupal::service('file_url_generator')->transformRelative($image_style->buildUrl($uri)), ] + $thumbnail->getArray()); $thumbnail->addCacheableDependency($image_style);