Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
21e9006
Update OC versions to preview.
sarahelsaig Jan 7, 2026
6882b27
Fix various errors.
sarahelsaig Jan 9, 2026
3873781
Fix obsolete IActionContextAccessor usage.
sarahelsaig Jan 9, 2026
e33a1d4
Fix remaining warnings.
sarahelsaig Jan 9, 2026
905ec3d
Upgrade scrutor.
sarahelsaig Jan 9, 2026
141f822
Upgrade OC preview.
sarahelsaig Jan 14, 2026
f196bb9
Update branch selector.
sarahelsaig Jan 19, 2026
5461c31
Update branch selectors.
sarahelsaig Jan 19, 2026
295bc58
CompatibilitySuppressions.xml
sarahelsaig Jan 20, 2026
b430ce5
Nuget.
sarahelsaig Jan 20, 2026
0d4666e
Delete all CompatibilitySuppressions so we may start from scratch.
sarahelsaig Jan 20, 2026
293be59
Upgrade OC preview.
sarahelsaig Jan 22, 2026
4d1d473
Fix obsoletes.
sarahelsaig Jan 22, 2026
1e85e1e
HL nuget
sarahelsaig Jan 22, 2026
e98c2a4
Update UITT NuGet.
sarahelsaig Jan 22, 2026
12e69cd
UC preview update.
sarahelsaig Jan 23, 2026
ff027c3
Merge remote-tracking branch 'origin/dev' into issue/OSOE-925
sarahelsaig Jan 23, 2026
55dbb38
Update HL nuget.
sarahelsaig Jan 23, 2026
cb01843
Update OC preview.
sarahelsaig Jan 27, 2026
2a9825c
Update HL NuGet.
sarahelsaig Jan 28, 2026
a3c1496
Replace obsolete DisplayedAs with WithDisplayName.
sarahelsaig Jan 30, 2026
3565654
Update verification code.
sarahelsaig Jan 30, 2026
4c3f83d
Update OC preview.
sarahelsaig Feb 4, 2026
c0897e7
Update OC preview.
sarahelsaig Feb 5, 2026
a3215af
Merge remote-tracking branch 'origin/dev' into issue/OSOE-925
sarahelsaig Feb 5, 2026
28869fa
Update HL Nuget.
sarahelsaig Feb 5, 2026
418f4d1
Update UITT nuget.
sarahelsaig Feb 5, 2026
90a6e04
Workaround.
sarahelsaig Feb 5, 2026
78cf83a
Upda
sarahelsaig Feb 6, 2026
8fe5a78
Update menu paths.
sarahelsaig Feb 7, 2026
d914e8a
Fix admin menu.
sarahelsaig Feb 7, 2026
c70ac49
Update OC to avoid missing method exceptions.
sarahelsaig Feb 12, 2026
283505f
Update OC previews to fix package downgrade.
sarahelsaig Feb 13, 2026
0db5936
Update OC preview.
sarahelsaig Feb 16, 2026
b960364
Merge remote-tracking branch 'origin/issue/OSOE-925' into issue/OSOE-925
sarahelsaig Feb 16, 2026
5640a57
Update OC preview and fix build errors.
sarahelsaig Feb 21, 2026
583ae07
Fix package downgrade.
sarahelsaig Feb 21, 2026
47dffc1
Update OC preview.
sarahelsaig Feb 22, 2026
f53762b
Update HL nuget.
sarahelsaig Feb 22, 2026
7d376e9
UITT nuget
sarahelsaig Feb 22, 2026
c6a4081
Update HL nuget correctly.
sarahelsaig Feb 22, 2026
efa5d0c
Update UITT nuget correctly.
sarahelsaig Feb 22, 2026
206c96d
Update OC preview.
sarahelsaig Mar 7, 2026
f6b96f3
nuget
sarahelsaig Mar 7, 2026
3139f87
Update OC preview.
sarahelsaig Mar 20, 2026
4cffa37
Update OC preview.
sarahelsaig Mar 29, 2026
c59c4ec
Update UITT nuget.
sarahelsaig Mar 29, 2026
f242ea5
Use OC module SDKs.
sarahelsaig Mar 30, 2026
59c6da5
Remove `<IsLombiqProject>true</IsLombiqProject>` from projects.
sarahelsaig Mar 31, 2026
fd5a05b
Update NuGet versions.
sarahelsaig Mar 31, 2026
351beb6
Use UI Test SDK where applicable.
sarahelsaig Mar 31, 2026
d1135c7
Create new SLNX files.
sarahelsaig Apr 2, 2026
c71d3b4
Update validate-nuget-publish.yml issue branch.
sarahelsaig Apr 2, 2026
25c0b67
Remove SLN files.
sarahelsaig Apr 3, 2026
7b7c163
Move "See the project website for detailed documentation." boilerplat…
sarahelsaig Apr 7, 2026
493e491
Update OC preview.
sarahelsaig Apr 8, 2026
6bbc551
Fix obsolete "As".
sarahelsaig Apr 11, 2026
4e6e6d0
Merge remote-tracking branch 'origin/dev' into issue/OSOE-925
sarahelsaig Apr 11, 2026
d386411
Fix and clean up GetOrCreate usages.
sarahelsaig Apr 11, 2026
ef1994b
Update HL Nuget.
sarahelsaig Apr 11, 2026
45b493e
Update OC preview.
sarahelsaig Apr 13, 2026
0e0ade2
Update UITT nuget.
sarahelsaig Apr 13, 2026
2277e5b
Update UITT NuGet.
sarahelsaig Apr 20, 2026
714704f
Merge remote-tracking branch 'origin/issue/OSOE-925' into issue/OSOE-…
sarahelsaig Apr 24, 2026
b3e61e0
Update NuGet and apply library SDK where applicable
sarahelsaig Apr 24, 2026
0a3d49b
Merge remote-tracking branch 'origin/issue/OSOE-1208' into issue/OSOE…
sarahelsaig Apr 25, 2026
9ad775a
Merge remote-tracking branch 'origin/dev' into issue/OSOE-1199
sarahelsaig Apr 25, 2026
b45cfca
Merge remote-tracking branch 'origin/dev' into issue/OSOE-925
sarahelsaig Apr 25, 2026
8561e41
Merge remote-tracking branch 'origin/issue/OSOE-925' into issue/OSOE-…
sarahelsaig Apr 25, 2026
a230dec
Merge remote-tracking branch 'origin/issue/OSOE-1208' into issue/OSOE…
sarahelsaig Apr 25, 2026
7218a85
Merge pull request #239 from Lombiq/issue/OSOE-1199
DemeSzabolcs Apr 27, 2026
c37a3ce
Update GHA branch selectors.
sarahelsaig Apr 27, 2026
b034b8a
Update OC preview.
sarahelsaig Apr 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ on:
jobs:
publish-nuget:
name: Publish to NuGet
uses: Lombiq/GitHub-Actions/.github/workflows/publish-nuget.yml@dev
uses: Lombiq/GitHub-Actions/.github/workflows/publish-nuget.yml@issue/OSOE-925
secrets:
API_KEY: ${{ secrets.DEFAULT_NUGET_PUBLISH_API_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/validate-nuget-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ on:
jobs:
validate-nuget-publish:
name: Validate NuGet Publish
uses: Lombiq/GitHub-Actions/.github/workflows/validate-nuget-publish.yml@dev
uses: Lombiq/GitHub-Actions/.github/workflows/validate-nuget-publish.yml@issue/OSOE-925
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal static class GeneratedMigrationCodes
private const string Page =
"""
await _contentDefinitionManager.AlterTypeDefinitionAsync("Page", type => type
.DisplayedAs("Page")
.WithDisplayName("Page")
.Creatable()
.Listable()
.Draftable()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<DefaultItemExcludes>$(DefaultItemExcludes);.git*</DefaultItemExcludes>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<Import Condition="'$(NuGetBuild)' != 'true'" Project="../../../Utilities/Lombiq.MSBuild.Targets/Lombiq.MSBuild.OrchardCore.Tests.UI.Sdk/Sdk/Import.props" />
<Import Condition="'$(NuGetBuild)' == 'true'" Project="Sdk.props" Sdk="Lombiq.MSBuild.OrchardCore.Tests.UI.Sdk" Version="1.0.1-alpha.10.osoe-1208" />

<PropertyGroup>
<Title>Lombiq Helpful Extensions for Orchard Core - UI Test Extensions</Title>
<Authors>Lombiq Technologies</Authors>
<Copyright>Copyright © 2013, Lombiq Technologies Ltd.</Copyright>
<Description>Lombiq Helpful Extensions for Orchard Core - UI Test Extensions: Extension methods that test various features in Lombiq Helpful Extensions for Orchard Core. See the project website for detailed documentation.</Description>
<PackageIcon>NuGetIcon.png</PackageIcon>
<CopyrightYear>2013</CopyrightYear>
<DescriptionBody>Extension methods that test various features in Lombiq Helpful Extensions for Orchard Core.</DescriptionBody>
<PackageTags>OrchardCore;Lombiq;AspNetCore;CodeGeneration;ShapeTracing;Widgets</PackageTags>
<RepositoryUrl>https://github.com/Lombiq/Helpful-Extensions</RepositoryUrl>
<PackageProjectUrl>https://github.com/Lombiq/Helpful-Extensions/tree/dev/Lombiq.HelpfulExtensions.Tests.UI</PackageProjectUrl>
<PackageLicenseExpression>BSD-3-Clause</PackageLicenseExpression>
</PropertyGroup>

<ItemGroup>
<None Include="Readme.md" />
<None Include="NuGetIcon.png" Pack="true" PackagePath="" />
<Content Include="Recipes\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="OrchardCore.ContentManagement.Abstractions" Version="2.1.0">
<PackageReference Include="OrchardCore.ContentManagement.Abstractions" Version="3.0.0-preview-18975">
<Aliases>OCCMA</Aliases>
</PackageReference>
</ItemGroup>
Expand All @@ -36,12 +33,6 @@
<ProjectReference Include="..\Lombiq.HelpfulExtensions\Lombiq.HelpfulExtensions.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' != 'true'">
<ProjectReference Include="..\..\..\..\test\Lombiq.UITestingToolbox\Lombiq.Tests.UI\Lombiq.Tests.UI.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="14.2.0" />
</ItemGroup>

<Import Condition="'$(NuGetBuild)' != 'true'" Project="../../../Utilities/Lombiq.MSBuild.Targets/Lombiq.MSBuild.OrchardCore.Tests.UI.Sdk/Sdk/Import.targets" />
<Import Condition="'$(NuGetBuild)' == 'true'" Project="Sdk.targets" Sdk="Lombiq.MSBuild.OrchardCore.Tests.UI.Sdk" Version="1.0.1-alpha.10.osoe-1208" />
</Project>
31 changes: 0 additions & 31 deletions Lombiq.HelpfulExtensions.sln

This file was deleted.

4 changes: 4 additions & 0 deletions Lombiq.HelpfulExtensions.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Solution>
<Project Path="Lombiq.HelpfulExtensions.Tests.UI/Lombiq.HelpfulExtensions.Tests.UI.csproj" />
<Project Path="Lombiq.HelpfulExtensions/Lombiq.HelpfulExtensions.csproj" />
</Solution>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task<IActionResult> Create(string fromContentItemId, string fromPar
if (!ModelState.IsValid) return BadRequest(ModelState);

return await _contentSetManager.CloneContentItemAsync(fromContentItemId, fromPartName, newKey) is { } content
? Redirect(_orchardHelper.GetItemEditUrl(content))
? Redirect(await _orchardHelper.GetItemEditUrlAsync(content))
: NotFound();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override IDisplayResult Edit(ContentTypeDefinition model, BuildEditorCont
codeBuilder.AppendLine(
CultureInfo.InvariantCulture,
$"await _contentDefinitionManager.AlterTypeDefinitionAsync(\"{name}\", type => type");
codeBuilder.AppendLine(CultureInfo.InvariantCulture, $" .DisplayedAs(\"{model.DisplayName}\")");
codeBuilder.AppendLine(CultureInfo.InvariantCulture, $" .WithDisplayName(\"{model.DisplayName}\")");

GenerateCodeForSettings(codeBuilder, model.GetSettings<ContentTypeSettings>());
AddSettingsWithout<ContentTypeSettings>(codeBuilder, model.Settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public static void SendEmailDeferred(this ShellScope shellScope, EmailParameters
Bcc = parameters.Bcc?.Join(","),
Subject = parameters.Subject,
ReplyTo = parameters.ReplyTo,
Body = parameters.Body,
IsHtmlBody = true,
HtmlBody = parameters.Body,
});

if (!result.Succeeded)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ public override IDisplayResult Edit(ContentItem model, BuildEditorContext contex

public override async Task<IDisplayResult> UpdateAsync(ContentItem model, UpdateEditorContext context)
{
var additionalStylingPart = model.As<AdditionalStylingPart>();

if (additionalStylingPart == null)
{
return null;
}
if (!model.Has<AdditionalStylingPart>()) return null;

await model.AlterAsync<AdditionalStylingPart>(model => context.Updater.TryUpdateModelAsync(model, Prefix));

Expand All @@ -31,12 +26,8 @@ public override async Task<IDisplayResult> UpdateAsync(ContentItem model, Update

private static void PopulateViewModel(ContentItem model, AdditionalStylingPart viewModel)
{
var additionalStylingPart = model.As<AdditionalStylingPart>();

if (additionalStylingPart != null)
{
viewModel.CustomClasses = additionalStylingPart.CustomClasses;
viewModel.RemoveGridExtensionClasses = additionalStylingPart.RemoveGridExtensionClasses;
}
if (!model.TryGet<AdditionalStylingPart>(out var additionalStylingPart)) return;
viewModel.CustomClasses = additionalStylingPart.CustomClasses;
viewModel.RemoveGridExtensionClasses = additionalStylingPart.RemoveGridExtensionClasses;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public ValueTask BuildNavigationAsync(string name, NavigationBuilder builder)
{
if (!name.EqualsOrdinalIgnoreCase("admin")) return ValueTask.CompletedTask;

builder.Add(T["Configuration"], configuration => configuration
.Add(T["Import/Export"], importExport => importExport
builder.Add(T["Tools"], tools => tools
.Add(T["Deployments"], deployments => deployments
.Add(T["Orchard 1 Recipe Migration"], T["Orchard 1 Recipe Migration"], migration => migration
.Action<OrchardRecipeMigrationAdminController>(_hca.HttpContext, controller => controller.Index())
.LocalNav()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ public class ListPartOrchardExportConverter : IOrchardExportConverter
public Task UpdateContentItemsAsync(XDocument document, IList<ContentItem> contentItems)
{
var itemsById = contentItems
.Where(item => !string.IsNullOrEmpty(item.As<OrchardIds>()?.ExportId))
.ToDictionary(item => item.As<OrchardIds>().ExportId);
.SelectWhere(
item => (Item: item, Ids: item.GetOrCreate<OrchardIds>()),
pair => !string.IsNullOrEmpty(pair.Ids.ExportId) && !string.IsNullOrEmpty(pair.Ids.Parent))
.ToDictionary(item => item.Ids.ExportId);

foreach (var item in itemsById.Values.Where(item => !string.IsNullOrEmpty(item.As<OrchardIds>().Parent)))
foreach (var (item, ids) in itemsById.Values)
{
var parentId = item.As<OrchardIds>().Parent;
if (!itemsById.TryGetValue(parentId, out var parent) || !parent.Has<ListPart>()) continue;
if (!itemsById.TryGetValue(ids.Parent, out var parentPair) || !parentPair.Item.Has<ListPart>()) continue;

item.Alter<ContainedPart>(part =>
{
part.ListContentItemId = parent.ContentItemId;
part.ListContentType = parent.ContentType;
part.ListContentItemId = parentPair.Item.ContentItemId;
part.ListContentType = parentPair.Item.ContentType;
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using Lombiq.HelpfulExtensions.Extensions.OrchardRecipeMigration.Controllers;
using Lombiq.HelpfulExtensions.Extensions.OrchardRecipeMigration.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Routing;
using OrchardCore;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.Entities;
Expand All @@ -21,30 +20,27 @@ public class OrchardExportToRecipeConverter : IOrchardExportToRecipeConverter
{
private readonly int batchSize = 50;

private readonly IActionContextAccessor _actionContextAccessor;
private readonly IContentManager _contentManager;
private readonly IIdGenerator _idGenerator;
private readonly IEnumerable<IOrchardContentConverter> _contentConverters;
private readonly IOrchardHelper _orchardHelper;
private readonly IEnumerable<IOrchardUserConverter> _userConverters;
private readonly IContentDefinitionManager _contentDefinitionManager;
private readonly IUrlHelperFactory _urlHelperFactory;

public OrchardExportToRecipeConverter(
IActionContextAccessor actionContextAccessor,
IContentDefinitionManager contentDefinitionManager,
IContentManager contentManager,
IIdGenerator idGenerator,
IEnumerable<IOrchardContentConverter> contentConverters,
IEnumerable<IOrchardUserConverter> userConverters,
IUrlHelperFactory urlHelperFactory)
IOrchardHelper orchardHelper,
IEnumerable<IOrchardUserConverter> userConverters)
{
_actionContextAccessor = actionContextAccessor;
_contentManager = contentManager;
_idGenerator = idGenerator;
_contentConverters = contentConverters;
_orchardHelper = orchardHelper;
_userConverters = userConverters;
_contentDefinitionManager = contentDefinitionManager;
_urlHelperFactory = urlHelperFactory;
}

public async Task<ConversionBatchResult> ConvertAsync(XDocument export, int page)
Expand Down Expand Up @@ -83,7 +79,7 @@ await _contentConverters
}
}

var urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccessor.ActionContext!);
var urlHelper = await _orchardHelper.GetUrlHelperAsync();

var hasNextPage = page < totalPages;
var nextUrl = hasNextPage ? urlHelper.Action(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Microsoft.Extensions.Logging;
using OrchardCore.DisplayManagement.Implementation;
using OrchardCore.DisplayManagement.Shapes;
using System.Linq;
using System.Threading.Tasks;

namespace Lombiq.HelpfulExtensions.Extensions.ShapeTracing;
Expand Down Expand Up @@ -53,12 +52,6 @@ void AddIfNotNullOrEmpty(string name, string value)
builderShapeInfo.AppendHtmlLine(string.Join(", ", shapeMetadata.Alternates));
}

if (shapeMetadata.BindingSources.Any())
{
builderShapeInfo.AppendHtml("Binding sources: ");
builderShapeInfo.AppendHtmlLine(string.Join(", ", shapeMetadata.BindingSources));
}

if (shapeMetadata.Wrappers.Count != 0)
{
builderShapeInfo.AppendHtml("Wrappers: ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public override async Task<HtmlString> RenderHtmlByIdAsync(string contentItemId)
var part = await GetSiteTextMarkdownBodyPartByIdAsync(contentItemId);
var culture = CultureInfo.CurrentCulture.Name;

if (part.As<LocalizationPart>() is { Culture: { } partCulture, LocalizationSet: { } localizationSet } &&
if (part.GetMaybe<LocalizationPart>() is { Culture: { } partCulture, LocalizationSet: { } localizationSet } &&
partCulture != culture &&
await _contentLocalizationManager.GetContentItemAsync(localizationSet, culture) is { } contentItem &&
contentItem.As<MarkdownBodyPart>() is { } localizedPart)
contentItem.TryGet<MarkdownBodyPart>(out var localizedPart))
{
part = localizedPart;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private async Task<MarkdownBodyPart> GetSiteTextMarkdownBodyPartByIdInnerAsync(s
throw new InvalidOperationException($"A content with the ID \"{contentItemId}\" does not exist.");
}

if (contentItem.As<MarkdownBodyPart>() is not { } part)
if (!contentItem.TryGet<MarkdownBodyPart>(out var part))
{
throw new InvalidOperationException(
$"A content with the ID \"{contentItemId}\" does not have a {nameof(MarkdownBodyPart)}.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
using Lombiq.HelpfulExtensions.Extensions.Widgets.ViewModels;
using Lombiq.HelpfulLibraries.OrchardCore.Liquid;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.Extensions.Localization;
using OrchardCore;
using OrchardCore.Liquid;
using OrchardCore.Navigation;
using System;
Expand All @@ -21,24 +20,21 @@ namespace Lombiq.HelpfulExtensions.Extensions.Widgets.Liquid;
public class MenuWidgetLiquidFilter : ILiquidFilter
{
private readonly ILiquidContentDisplayService _liquidContentDisplayService;
private readonly Lazy<IUrlHelper> _urlHelperLazy;
private readonly IOrchardHelper _orchardHelper;
private readonly IStringLocalizer<MenuWidgetLiquidFilter> T;

public MenuWidgetLiquidFilter(
IActionContextAccessor actionContextAccessor,
ILiquidContentDisplayService liquidContentDisplayService,
IStringLocalizer<MenuWidgetLiquidFilter> stringLocalizer,
IUrlHelperFactory urlHelperFactory)
IOrchardHelper orchardHelper,
IStringLocalizer<MenuWidgetLiquidFilter> stringLocalizer)
{
_liquidContentDisplayService = liquidContentDisplayService;

_urlHelperLazy = new Lazy<IUrlHelper>(() =>
urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext!));
_orchardHelper = orchardHelper;

T = stringLocalizer;
}

public ValueTask<FluidValue> ProcessAsync(FluidValue input, FilterArguments arguments, LiquidTemplateContext context)
public async ValueTask<FluidValue> ProcessAsync(FluidValue input, FilterArguments arguments, LiquidTemplateContext context)
{
bool noWrapper, localNav;
string classes;
Expand All @@ -63,9 +59,10 @@ public ValueTask<FluidValue> ProcessAsync(FluidValue input, FilterArguments argu
_ => null,
};

UpdateMenuItems(menuItems, localNav);
var urlHelper = await _orchardHelper.GetUrlHelperAsync();
UpdateMenuItems(menuItems, localNav, urlHelper);

return _liquidContentDisplayService.DisplayNewAsync<MenuWidgetViewModel>(
return await _liquidContentDisplayService.DisplayNewAsync<MenuWidgetViewModel>(
WidgetTypes.MenuWidget,
model =>
{
Expand All @@ -75,22 +72,22 @@ public ValueTask<FluidValue> ProcessAsync(FluidValue input, FilterArguments argu
});
}

private void UpdateMenuItems(IEnumerable<MenuItem> menuItems, bool localNav)
private static void UpdateMenuItems(IEnumerable<MenuItem> menuItems, bool localNav, IUrlHelper urlHelper)
{
if (menuItems == null) return;

foreach (var item in menuItems)
{
if (!string.IsNullOrEmpty(item.Url))
{
var finalUrl = _urlHelperLazy.Value.Content(item.Url);
var finalUrl = urlHelper.Content(item.Url);
item.Url = finalUrl;
item.Href = finalUrl;
}

item.LocalNav = localNav || item.LocalNav;

UpdateMenuItems(item.Items, localNav);
UpdateMenuItems(item.Items, localNav, urlHelper);
}
}

Expand Down
Loading
Loading