diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs index 1c8c7c7d4f..6916f2ea3f 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs @@ -4,14 +4,9 @@ using System; using System.Collections.Generic; using System.Linq; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using Umbraco.Cms.Core.Configuration; -using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Logging; using Umbraco.Cms.Core.Models.Blocks; using Umbraco.Cms.Core.Models.PublishedContent; -using Umbraco.Cms.Web.Common.DependencyInjection; using Umbraco.Extensions; namespace Umbraco.Cms.Core.PropertyEditors.ValueConverters @@ -22,20 +17,12 @@ namespace Umbraco.Cms.Core.PropertyEditors.ValueConverters private readonly IProfilingLogger _proflog; private readonly BlockEditorConverter _blockConverter; private readonly BlockListEditorDataConverter _blockListEditorDataConverter; - private readonly ModelsBuilderSettings _modelsBuilderSettings; - [Obsolete("Use ctor injecting ModelsBuilderSettings")] public BlockListPropertyValueConverter(IProfilingLogger proflog, BlockEditorConverter blockConverter) - : this(proflog, blockConverter,StaticServiceProvider.Instance.GetRequiredService>()) - { - } - - public BlockListPropertyValueConverter(IProfilingLogger proflog, BlockEditorConverter blockConverter, IOptions modelsBuilderOptions) { _proflog = proflog; _blockConverter = blockConverter; _blockListEditorDataConverter = new BlockListEditorDataConverter(); - _modelsBuilderSettings = modelsBuilderOptions?.Value; } /// @@ -129,7 +116,7 @@ namespace Umbraco.Cms.Core.PropertyEditors.ValueConverters } // Get settings type from configuration - var settingsType = blockConfig.SettingsElementTypeKey.HasValue && _modelsBuilderSettings.ModelsMode != ModelsMode.Nothing + var settingsType = blockConfig.SettingsElementTypeKey.HasValue ? _blockConverter.GetModelType(blockConfig.SettingsElementTypeKey.Value) : typeof(IPublishedElement); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockListPropertyValueConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockListPropertyValueConverterTests.cs index 09fc427d12..084bf03370 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockListPropertyValueConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockListPropertyValueConverterTests.cs @@ -2,11 +2,9 @@ // See LICENSE for more details. using System; -using Microsoft.Extensions.Options; using Moq; using NUnit.Framework; using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Logging; using Umbraco.Cms.Core.Models.Blocks; using Umbraco.Cms.Core.Models.PublishedContent; @@ -64,10 +62,9 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.PropertyEditors { IPublishedSnapshotAccessor publishedSnapshotAccessor = GetPublishedSnapshotAccessor(); var publishedModelFactory = new NoopPublishedModelFactory(); - var modelsBuilderSettings = Mock.Of>(x => x.Value == new ModelsBuilderSettings()); var editor = new BlockListPropertyValueConverter( Mock.Of(), - new BlockEditorConverter(publishedSnapshotAccessor, publishedModelFactory), modelsBuilderSettings); + new BlockEditorConverter(publishedSnapshotAccessor, publishedModelFactory)); return editor; }