diff --git a/src/Umbraco.Core/Composing/IUserComposer.cs b/src/Umbraco.Core/Composing/IUserComposer.cs index 94c6aa9cad..8e07dae672 100644 --- a/src/Umbraco.Core/Composing/IUserComposer.cs +++ b/src/Umbraco.Core/Composing/IUserComposer.cs @@ -6,7 +6,6 @@ /// /// User composers compose after core composers, and before the final composer. /// - [ComposeAfter(typeof(IComposer))] public interface IUserComposer : IComposer { } } diff --git a/src/Umbraco.Examine.Lucene/ExamineLuceneComposer.cs b/src/Umbraco.Examine.Lucene/ExamineLuceneComposer.cs new file mode 100644 index 0000000000..1243e01578 --- /dev/null +++ b/src/Umbraco.Examine.Lucene/ExamineLuceneComposer.cs @@ -0,0 +1,18 @@ +// Copyright (c) Umbraco. +// See LICENSE for more details. + +using Umbraco.Cms.Core.Composing; +using Umbraco.Cms.Core.DependencyInjection; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Infrastructure.Examine +{ + // We want to run after core composers since we are replacing some items + public sealed class ExamineLuceneComposer :IComposer + { + public void Compose(IUmbracoBuilder builder) + { + builder.AddExamineLucene(); + } + } +} diff --git a/src/Umbraco.Examine.Lucene/ExamineLuceneFinalComposer.cs b/src/Umbraco.Examine.Lucene/ExamineLuceneFinalComposer.cs new file mode 100644 index 0000000000..ab3476cb70 --- /dev/null +++ b/src/Umbraco.Examine.Lucene/ExamineLuceneFinalComposer.cs @@ -0,0 +1,17 @@ +// Copyright (c) Umbraco. +// See LICENSE for more details. + +using Umbraco.Cms.Core.Composing; +using Umbraco.Cms.Core.DependencyInjection; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Infrastructure.Examine +{ + // examine's Lucene final composer composes after all user composers + // and *also* after ICoreComposer (in case IUserComposer is disabled) + [ComposeAfter(typeof(IUserComposer))] + public class ExamineLuceneFinalComposer : IComposer + { + public void Compose(IUmbracoBuilder builder) => builder.AddExamineIndexConfiguration(); + } +} diff --git a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs index 4c9e6671d2..cdff3a9168 100644 --- a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs +++ b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs @@ -90,9 +90,13 @@ namespace Umbraco.Cms.Tests.Integration.Testing s_firstTestInSession = false; // Ensure CoreRuntime stopped (now it's a HostedService) - IHost host = Services.GetRequiredService(); - await host.StopAsync(); - host.Dispose(); + IHost host = Services?.GetService(); + if (host is not null) + { + await host.StopAsync(); + host.Dispose(); + } + } [TearDown] diff --git a/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs b/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs index b76a01c98e..38ea80e709 100644 --- a/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs +++ b/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs @@ -52,7 +52,6 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services protected override void CustomTestSetup(IUmbracoBuilder builder) { builder.Services.AddUnique(); - // builder.AddCoreNotifications(); } private void AssertJsonStartsWith(int id, string expected) diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs index b792ab6041..e0ab2d630a 100644 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs @@ -464,6 +464,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Components { } + public class Composer4 : TestComposerBase { } @@ -524,6 +525,8 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Components { } + [ComposeAfter(typeof(Composer2))] + [ComposeAfter(typeof(Composer4))] public class Composer9 : TestComposerBase, ITestComposer { } diff --git a/src/Umbraco.Web.UI.Client/src/navigation.controller.js b/src/Umbraco.Web.UI.Client/src/navigation.controller.js index 11bea9b275..06a7a62b88 100644 --- a/src/Umbraco.Web.UI.Client/src/navigation.controller.js +++ b/src/Umbraco.Web.UI.Client/src/navigation.controller.js @@ -298,7 +298,8 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar } /** - * Based on the current state of the application, this configures the scope variables that control the main tree and language drop down + * Based on the current state of the application, this configures the scope variables that + * l the main tree and language drop down */ function configureTreeAndLanguages() { diff --git a/src/Umbraco.Web.UI.NetCore/Startup.cs b/src/Umbraco.Web.UI.NetCore/Startup.cs index 90a632599c..0419a8c0e4 100644 --- a/src/Umbraco.Web.UI.NetCore/Startup.cs +++ b/src/Umbraco.Web.UI.NetCore/Startup.cs @@ -44,7 +44,6 @@ namespace Umbraco.Cms.Web.UI.NetCore .AddBackOffice() .AddWebsite() .AddComposers() - .AddExamineIndexConfiguration() .Build(); #pragma warning restore IDE0022 // Use expression body for methods