From 1e32d59ecbfc2745f598946639f23a7d928f8b03 Mon Sep 17 00:00:00 2001 From: Justin Neville <67802060+justin-nevitech@users.noreply.github.com> Date: Mon, 21 Oct 2024 08:53:17 +0100 Subject: [PATCH] Query for media using the full file path as well as the original file path for files that contain the sizes in the file name (i.e. image_200x200.jpg) (#17314) --- .../Persistence/Repositories/Implement/MediaRepository.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs index 73cb423837..ca488f8cc2 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs @@ -305,20 +305,20 @@ public class MediaRepository : ContentRepositoryBase sql = GetBaseQuery(QueryType.Single, joinMediaVersion: true) - .Where(x => x.Path == umbracoFileValue) + .Where(x => x.Path == mediaPath || (isResized && x.Path == originalMediaPath)) .SelectTop(1); ContentDto? dto = Database.Fetch(sql).FirstOrDefault();