Skip to content

Commit

Permalink
VCST-1385: External link encoded after saving (#732)
Browse files Browse the repository at this point in the history
fix: Resolves issue with External link encoded after saving
  • Loading branch information
OlegoO committed Jul 10, 2024
1 parent bb9c9e0 commit 6497e83
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/VirtoCommerce.CatalogModule.Data/Services/ItemService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using FluentValidation;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
Expand Down Expand Up @@ -243,14 +242,14 @@ protected virtual async Task LoadDependencies(IList<CatalogProduct> products)
foreach (var image in allImages.Where(x => !string.IsNullOrEmpty(x.Url)))
{
image.RelativeUrl = !string.IsNullOrEmpty(image.RelativeUrl) ? image.RelativeUrl : image.Url;
image.Url = _blobUrlResolver.GetAbsoluteUrl(HttpUtility.UrlDecode(image.Url));
image.Url = _blobUrlResolver.GetAbsoluteUrl(image.Url);
}

var allAssets = new { products }.GetFlatObjectsListWithInterface<IHasAssets>().Where(x => x.Assets != null).SelectMany(x => x.Assets);
foreach (var asset in allAssets.Where(x => !string.IsNullOrEmpty(x.Url)))
{
asset.RelativeUrl = !string.IsNullOrEmpty(asset.RelativeUrl) ? asset.RelativeUrl : asset.Url;
asset.Url = _blobUrlResolver.GetAbsoluteUrl(HttpUtility.UrlDecode(asset.Url));
asset.Url = _blobUrlResolver.GetAbsoluteUrl(asset.Url);
}

foreach (var product in products)
Expand Down

0 comments on commit 6497e83

Please sign in to comment.