Skip to content

Commit

Permalink
Merge branch 'release/6.14.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vc-ci committed Apr 3, 2023
2 parents 4b0306b + f9c641e commit 74b2bb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Authors>VirtoCommerce</Authors>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>6.13.0</VersionPrefix>
<VersionPrefix>6.14.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
</PropertyGroup>
Expand Down
12 changes: 8 additions & 4 deletions VirtoCommerce.Storefront/Controllers/Api/ApiCommonController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,20 @@ public async Task<SlugInfoResult> GetInfoBySlugAsync(string slug, [FromQuery] st
{
var result = new SlugInfoResult();

var seoInfos = await _seoInfoService.GetBestMatchingSeoInfos(slug, WorkContext.CurrentStore, culture);
if (string.IsNullOrEmpty(slug))
{
return result;
}

var segments = slug.Split("/", StringSplitOptions.RemoveEmptyEntries);
var lastSegment = segments.Last();
var seoInfos = await _seoInfoService.GetBestMatchingSeoInfos(lastSegment, WorkContext.CurrentStore, culture);
var bestSeoInfo = seoInfos.FirstOrDefault();

result.EntityInfo = bestSeoInfo;


if (result.EntityInfo == null)
{
var pageUrl = slug == "home" ? "/" : $"/{slug}";
var pageUrl = slug == "__index__home__page__" ? "/" : $"/{slug}";
try
{
var pages = WorkContext.Pages.Where(p =>
Expand Down

0 comments on commit 74b2bb4

Please sign in to comment.