Skip to content

Commit

Permalink
Merge branch 'release/6.33.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vc-ci committed Oct 30, 2023
2 parents 7dd0286 + aa849a9 commit 1429b28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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.32.0</VersionPrefix>
<VersionPrefix>6.33.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public async Task<ActionResult> Feedback([FromBody] ContactForm model)

return Ok();
}

[HttpPost("slug")]
public async Task<SlugInfoResult> GetSlugInfoBySlugAsync([FromBody] SlugInfoRequest slugInfoRequest)
{
Expand Down Expand Up @@ -102,15 +102,15 @@ private async Task<SlugInfoResult> GetSlugInfoAsync(string slug, string culture)
var bestSeoInfo = seoInfos.FirstOrDefault();
result.EntityInfo = bestSeoInfo;

if (result.EntityInfo == null)
if (result.EntityInfo == null || result.EntityInfo.ObjectType == "ContentFile")
{
var pageUrl = slug == "__index__home__page__" ? "/" : $"/{slug}";
try
{
var pages = WorkContext.Pages.Where(p =>
string.Equals(p.Url, pageUrl, StringComparison.OrdinalIgnoreCase)
|| string.Equals(p.Url, slug, StringComparison.OrdinalIgnoreCase)
);
).ToList();

var page = pages.FirstOrDefault(x => x.Language.CultureName.EqualsInvariant(culture))
?? pages.FirstOrDefault(x => x.Language.IsInvariant)
Expand Down

0 comments on commit 1429b28

Please sign in to comment.