diff --git a/src/Umbraco.Core/Composing/IUserComposer.cs b/src/Umbraco.Core/Composing/IUserComposer.cs deleted file mode 100644 index fe5af3a985..0000000000 --- a/src/Umbraco.Core/Composing/IUserComposer.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Umbraco.Cms.Core.Composing -{ - /// - /// Represents a user . - /// - [System.Obsolete("This interface is obsolete. Use IComposer instead.")] - public interface IUserComposer : IComposer - { } -} diff --git a/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs b/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs index 45a9bc98ed..49f07f0bdd 100644 --- a/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs @@ -76,12 +76,6 @@ namespace Umbraco.Cms.Core.Configuration.Models [DefaultValue(StaticEnableDefaultCharReplacements)] public bool EnableDefaultCharReplacements { get; set; } = StaticEnableDefaultCharReplacements; - /// - /// Add additional character replacements, or override defaults - /// - [Obsolete("Use the GetCharReplacements extension method in the Umbraco.Extensions namespace instead. Scheduled for removal in V11")] - public IEnumerable CharCollection { get; set; } = DefaultCharCollection; - /// /// Add additional character replacements, or override defaults /// diff --git a/src/Umbraco.Core/Constants-Conventions.cs b/src/Umbraco.Core/Constants-Conventions.cs index cb34901e6c..80b285aef4 100644 --- a/src/Umbraco.Core/Constants-Conventions.cs +++ b/src/Umbraco.Core/Constants-Conventions.cs @@ -186,54 +186,6 @@ namespace Umbraco.Cms.Core public const string CommentsLabel = "Comments"; - /// - /// Property alias for the Approved boolean of a Member - /// - [Obsolete("IsApproved is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")] - public const string IsApproved = "umbracoMemberApproved"; - [Obsolete("Use the stateApproved translation in the user area instead, scheduled for removal in V11")] - public const string IsApprovedLabel = "Is Approved"; - - /// - /// Property alias for the Locked out boolean of a Member - /// - [Obsolete("IsLockedOut is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")] - public const string IsLockedOut = "umbracoMemberLockedOut"; - [Obsolete("Use the stateLockedOut translation in the user area instead, scheduled for removal in V11")] - public const string IsLockedOutLabel = "Is Locked Out"; - - /// - /// Property alias for the last date the Member logged in - /// - [Obsolete("LastLoginDate is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")] - public const string LastLoginDate = "umbracoMemberLastLogin"; - [Obsolete("Use the lastLogin translation in the user area instead, scheduled for removal in V11")] - public const string LastLoginDateLabel = "Last Login Date"; - - /// - /// Property alias for the last date a Member changed its password - /// - [Obsolete("LastPasswordChangeDate is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")] - public const string LastPasswordChangeDate = "umbracoMemberLastPasswordChangeDate"; - [Obsolete("Use the lastPasswordChangeDate translation in the user area instead, scheduled for removal in V11")] - public const string LastPasswordChangeDateLabel = "Last Password Change Date"; - - /// - /// Property alias for the last date a Member was locked out - /// - [Obsolete("LastLockoutDate is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")] - public const string LastLockoutDate = "umbracoMemberLastLockoutDate"; - [Obsolete("Use the lastLockoutDate translation in the user area instead, scheduled for removal in V11")] - public const string LastLockoutDateLabel = "Last Lockout Date"; - - /// - /// Property alias for the number of failed login attempts - /// - [Obsolete("FailedPasswordAttempts is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")] - public const string FailedPasswordAttempts = "umbracoMemberFailedPasswordAttempts"; - [Obsolete("Use the failedPasswordAttempts translation in the user area instead, scheduled for removal in V11")] - public const string FailedPasswordAttemptsLabel = "Failed Password Attempts"; - /// /// The standard properties group alias for membership properties. /// diff --git a/src/Umbraco.Core/DependencyInjection/ServiceCollectionExtensions.cs b/src/Umbraco.Core/DependencyInjection/ServiceCollectionExtensions.cs index 6c806ce0db..6a3d020671 100644 --- a/src/Umbraco.Core/DependencyInjection/ServiceCollectionExtensions.cs +++ b/src/Umbraco.Core/DependencyInjection/ServiceCollectionExtensions.cs @@ -54,15 +54,6 @@ namespace Umbraco.Extensions services.AddUnique(factory => (TImplementing)factory.GetRequiredService(), lifetime); } - // TODO(V11): Remove this function. - [Obsolete("This method is functionally equivalent to AddSingleton() please use that instead.")] - public static void AddUnique(this IServiceCollection services) - where TImplementing : class - { - services.RemoveAll(); - services.AddSingleton(); - } - /// /// Adds a service of type with an implementation factory method to the specified . /// diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.CollectionBuilders.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.CollectionBuilders.cs index cba4a95c8e..5259c2a8a9 100644 --- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.CollectionBuilders.cs +++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.CollectionBuilders.cs @@ -84,10 +84,6 @@ namespace Umbraco.Cms.Core.DependencyInjection return builder; } - [Obsolete("Use AddEmbedProvider instead. This will be removed in Umbraco 10")] - public static IUmbracoBuilder AddOEmbedProvider(this IUmbracoBuilder builder) - where T : class, IEmbedProvider => AddEmbedProvider(builder); - /// /// Register a section. /// diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs index a7d7aaaded..9133405f52 100644 --- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs +++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs @@ -263,14 +263,6 @@ namespace Umbraco.Cms.Core.DependencyInjection public static MediaUrlGeneratorCollectionBuilder MediaUrlGenerators(this IUmbracoBuilder builder) => builder.WithCollectionBuilder(); - /// - /// Gets the backoffice OEmbed Providers collection builder. - /// - /// The builder. - [Obsolete("Use EmbedProviders() instead")] - public static EmbedProvidersCollectionBuilder OEmbedProviders(this IUmbracoBuilder builder) - => EmbedProviders(builder); - /// /// Gets the backoffice Embed Providers collection builder. /// diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs index 57607d347a..6586230081 100644 --- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs +++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs @@ -100,8 +100,6 @@ public static partial class UmbracoBuilderExtensions Constants.Configuration.NamedOptions.InstallDefaultData.MemberTypes, builder.Config.GetSection($"{Constants.Configuration.ConfigInstallDefaultData}:{Constants.Configuration.NamedOptions.InstallDefaultData.MemberTypes}")); - builder.Services.Configure(options => options.MergeReplacements(builder.Config)); - return builder; } } diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs index 75b4bb4aec..84ade2837d 100644 --- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs +++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs @@ -309,7 +309,6 @@ namespace Umbraco.Cms.Core.DependencyInjection factory.GetRequiredService(), factory.GetRequiredService() )); - Services.AddUnique(factory => factory.GetRequiredService()); Services.AddUnique(factory => factory.GetRequiredService()); Services.AddUnique(factory => new LocalizedTextService( factory.GetRequiredService>(), diff --git a/src/Umbraco.Core/Extensions/EnumExtensions.cs b/src/Umbraco.Core/Extensions/EnumExtensions.cs index e13467ef32..c88a2d8b2f 100644 --- a/src/Umbraco.Core/Extensions/EnumExtensions.cs +++ b/src/Umbraco.Core/Extensions/EnumExtensions.cs @@ -10,22 +10,6 @@ namespace Umbraco.Extensions /// public static class EnumExtensions { - /// - /// Determines whether all the flags/bits are set within the enum value. - /// - /// The enum type. - /// The enum value. - /// The flags. - /// - /// true if all the flags/bits are set within the enum value; otherwise, false. - /// - [Obsolete("Use Enum.HasFlag() or bitwise operations (if performance is important) instead.")] - public static bool HasFlagAll(this T value, T flags) - where T : Enum - { - return value.HasFlag(flags); - } - /// /// Determines whether any of the flags/bits are set within the enum value. /// diff --git a/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs b/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs index e9e6618f8c..65c4e506ce 100644 --- a/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs +++ b/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs @@ -32,26 +32,6 @@ namespace Umbraco.Extensions return MergeUnique(requestHandlerSettings.UserDefinedCharCollection, RequestHandlerSettings.DefaultCharCollection); } - /// - /// Merges CharCollection and UserDefinedCharCollection, prioritizing UserDefinedCharCollection - /// - internal static void MergeReplacements(this RequestHandlerSettings requestHandlerSettings, IConfiguration configuration) - { - string sectionKey = $"{Constants.Configuration.ConfigRequestHandler}:"; - - IEnumerable charCollection = GetReplacements( - configuration, - $"{sectionKey}{nameof(RequestHandlerSettings.CharCollection)}"); - - IEnumerable userDefinedCharCollection = GetReplacements( - configuration, - $"{sectionKey}{nameof(requestHandlerSettings.UserDefinedCharCollection)}"); - - IEnumerable mergedCollection = MergeUnique(userDefinedCharCollection, charCollection); - - requestHandlerSettings.UserDefinedCharCollection = mergedCollection; - } - private static IEnumerable GetReplacements(IConfiguration configuration, string key) { var replacements = new List(); diff --git a/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs b/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs index daeea79f02..d107e85385 100644 --- a/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs +++ b/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs @@ -26,20 +26,6 @@ namespace Umbraco.Cms.Core.HealthChecks.Checks.Security private readonly bool _metaTagOptionAvailable; private static HttpClient? s_httpClient; - [Obsolete("Use ctor without value.")] - protected BaseHttpHeaderCheck( - IHostingEnvironment hostingEnvironment, - ILocalizedTextService textService, - string header, - string value, - string localizedTextPrefix, - bool metaTagOptionAvailable) :this(hostingEnvironment, textService, header, localizedTextPrefix, metaTagOptionAvailable) - { - - } - - [Obsolete("Save ILocalizedTextService in a field on the super class instead of using this")] - protected ILocalizedTextService LocalizedTextService => _textService; /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Core/IO/ViewHelper.cs b/src/Umbraco.Core/IO/ViewHelper.cs index 9bf87c3407..649c89cb08 100644 --- a/src/Umbraco.Core/IO/ViewHelper.cs +++ b/src/Umbraco.Core/IO/ViewHelper.cs @@ -14,13 +14,6 @@ namespace Umbraco.Cms.Core.IO private readonly IFileSystem _viewFileSystem; private readonly IDefaultViewContentProvider _defaultViewContentProvider; - [Obsolete("Use ctor with all params")] - public ViewHelper(IFileSystem viewFileSystem) - { - _viewFileSystem = viewFileSystem ?? throw new ArgumentNullException(nameof(viewFileSystem)); - _defaultViewContentProvider = StaticServiceProvider.Instance.GetRequiredService(); - } - public ViewHelper(FileSystems fileSystems, IDefaultViewContentProvider defaultViewContentProvider) { _viewFileSystem = fileSystems.MvcViewsFileSystem ?? throw new ArgumentNullException(nameof(fileSystems)); @@ -68,15 +61,6 @@ namespace Umbraco.Cms.Core.IO return viewContent; } - [Obsolete("Inject IDefaultViewContentProvider instead")] - public static string GetDefaultFileContent(string? layoutPageAlias = null, string? modelClassName = null, - string? modelNamespace = null, string? modelNamespaceAlias = null) - { - var viewContentProvider = StaticServiceProvider.Instance.GetRequiredService(); - return viewContentProvider.GetDefaultFileContent(layoutPageAlias, modelClassName, modelNamespace, - modelNamespaceAlias); - } - private string SaveTemplateToFile(ITemplate template) { var design = template.Content.IsNullOrWhiteSpace() ? EnsureInheritedLayout(template) : template.Content!; diff --git a/src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs b/src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs index 15286d249f..7855df76f7 100644 --- a/src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs +++ b/src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs @@ -27,15 +27,6 @@ namespace Umbraco.Cms.Core.Install.InstallSteps _siteIdentifierService = siteIdentifierService; } - [Obsolete("Use constructor that takes GlobalSettings and ISiteIdentifierService")] - public TelemetryIdentifierStep( - ILogger logger, - IOptions globalSettings, - IConfigManipulator configManipulator) - : this(globalSettings, StaticServiceProvider.Instance.GetRequiredService()) - { - } - public override Task ExecuteAsync(object model) { _siteIdentifierService.TryCreateSiteIdentifier(out _); diff --git a/src/Umbraco.Core/Models/ContentEditing/UserGroupPermissionsSave.cs b/src/Umbraco.Core/Models/ContentEditing/UserGroupPermissionsSave.cs index e782d69635..bc9ac96331 100644 --- a/src/Umbraco.Core/Models/ContentEditing/UserGroupPermissionsSave.cs +++ b/src/Umbraco.Core/Models/ContentEditing/UserGroupPermissionsSave.cs @@ -29,14 +29,5 @@ namespace Umbraco.Cms.Core.Models.ContentEditing /// [DataMember(Name = "permissions")] public IDictionary> AssignedPermissions { get; set; } - - [Obsolete("This is not used and will be removed in Umbraco 10")] - public IEnumerable Validate(ValidationContext validationContext) - { - if (AssignedPermissions.SelectMany(x => x.Value).Any(x => x.IsNullOrWhiteSpace())) - { - yield return new ValidationResult("A permission value cannot be null or empty", new[] { "Permissions" }); - } - } } } diff --git a/src/Umbraco.Core/Models/ContentType.cs b/src/Umbraco.Core/Models/ContentType.cs index 9c21cf5e80..1e011bbd07 100644 --- a/src/Umbraco.Core/Models/ContentType.cs +++ b/src/Umbraco.Core/Models/ContentType.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Core.Models /// [Serializable] [DataContract(IsReference = true)] - public class ContentType : ContentTypeCompositionBase, IContentTypeWithHistoryCleanup + public class ContentType : ContentTypeCompositionBase, IContentType { public const bool SupportsPublishingConst = true; diff --git a/src/Umbraco.Core/Models/IContentType.cs b/src/Umbraco.Core/Models/IContentType.cs index e3fd83fcd3..4d693f9a50 100644 --- a/src/Umbraco.Core/Models/IContentType.cs +++ b/src/Umbraco.Core/Models/IContentType.cs @@ -4,19 +4,6 @@ using Umbraco.Cms.Core.Models.ContentEditing; namespace Umbraco.Cms.Core.Models { - /// - /// Defines a content type that contains a history cleanup policy. - /// - [Obsolete("This will be merged into IContentType in Umbraco 10.")] - public interface IContentTypeWithHistoryCleanup : IContentType - { - /// - /// Gets or sets the history cleanup configuration. - /// - /// The history cleanup configuration. - HistoryCleanup? HistoryCleanup { get; set; } - } - /// /// Defines a ContentType, which Content is based on /// @@ -70,5 +57,11 @@ namespace Umbraco.Cms.Core.Models /// /// IContentType DeepCloneWithResetIdentities(string newAlias); + + /// + /// Gets or sets the history cleanup configuration. + /// + /// The history cleanup configuration. + HistoryCleanup? HistoryCleanup { get; set; } } } diff --git a/src/Umbraco.Core/Models/Language.cs b/src/Umbraco.Core/Models/Language.cs index 20d936af61..cc526b1518 100644 --- a/src/Umbraco.Core/Models/Language.cs +++ b/src/Umbraco.Core/Models/Language.cs @@ -29,13 +29,6 @@ namespace Umbraco.Cms.Core.Models _cultureName = cultureName ?? throw new ArgumentNullException(nameof(cultureName)); } - [Obsolete("Use the constructor not requiring global settings and accepting an explicit name instead, scheduled for removal in V11.")] - public Language(GlobalSettings globalSettings, string isoCode) - { - _isoCode = isoCode ?? throw new ArgumentNullException(nameof(isoCode)); - _cultureName = CultureInfo.GetCultureInfo(isoCode).EnglishName; - } - /// [DataMember] public string IsoCode diff --git a/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs b/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs index bacab0b7cf..7d58a69616 100644 --- a/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs +++ b/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs @@ -37,20 +37,6 @@ namespace Umbraco.Cms.Core.Models.Mapping private readonly IShortStringHelper _shortStringHelper; private ContentSettings _contentSettings; - - [Obsolete("Use ctor with all params injected")] - public ContentTypeMapDefinition(CommonMapper commonMapper, PropertyEditorCollection propertyEditors, - IDataTypeService dataTypeService, IFileService fileService, - IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, - IMemberTypeService memberTypeService, - ILoggerFactory loggerFactory, IShortStringHelper shortStringHelper, IOptions globalSettings, - IHostingEnvironment hostingEnvironment) - : this(commonMapper, propertyEditors, dataTypeService, fileService, contentTypeService, mediaTypeService, - memberTypeService, loggerFactory, shortStringHelper, globalSettings, hostingEnvironment, - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - public ContentTypeMapDefinition(CommonMapper commonMapper, PropertyEditorCollection propertyEditors, IDataTypeService dataTypeService, IFileService fileService, IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, @@ -131,7 +117,7 @@ namespace Umbraco.Cms.Core.Models.Mapping MapSaveToTypeBase(source, target, context); MapComposition(source, target, alias => _contentTypeService.Get(alias)); - if (target is IContentTypeWithHistoryCleanup targetWithHistoryCleanup) + if (target is IContentType targetWithHistoryCleanup) { MapHistoryCleanup(source, targetWithHistoryCleanup); } @@ -147,7 +133,7 @@ namespace Umbraco.Cms.Core.Models.Mapping : _fileService.GetTemplate(source.DefaultTemplate)); } - private static void MapHistoryCleanup(DocumentTypeSave source, IContentTypeWithHistoryCleanup target) + private static void MapHistoryCleanup(DocumentTypeSave source, IContentType target) { // If source history cleanup is null we don't have to map all properties if (source.HistoryCleanup is null) @@ -209,7 +195,7 @@ namespace Umbraco.Cms.Core.Models.Mapping { MapTypeToDisplayBase(source, target); - if (source is IContentTypeWithHistoryCleanup sourceWithHistoryCleanup) + if (source is IContentType sourceWithHistoryCleanup) { target.HistoryCleanup = new HistoryCleanupViewModel { diff --git a/src/Umbraco.Core/Models/Mapping/DictionaryMapDefinition.cs b/src/Umbraco.Core/Models/Mapping/DictionaryMapDefinition.cs index a5db1d4b96..2a776fd2fd 100644 --- a/src/Umbraco.Core/Models/Mapping/DictionaryMapDefinition.cs +++ b/src/Umbraco.Core/Models/Mapping/DictionaryMapDefinition.cs @@ -17,12 +17,6 @@ namespace Umbraco.Cms.Core.Models.Mapping private readonly ILocalizationService _localizationService; private readonly CommonMapper? _commonMapper; - [Obsolete("Use the constructor with the CommonMapper")] - public DictionaryMapDefinition(ILocalizationService localizationService) - { - _localizationService = localizationService; - } - public DictionaryMapDefinition(ILocalizationService localizationService, CommonMapper commonMapper) { _localizationService = localizationService; diff --git a/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs b/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs index 9a39051590..1b32bca397 100644 --- a/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs +++ b/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs @@ -73,7 +73,8 @@ namespace Umbraco.Cms.Core.Models.Mapping return resolved; } - [Obsolete("Use MapMembershipProperties. Will be removed in Umbraco 10.")] + // We need this because we call GetCustomGenericProperties from TabsAndPropertiesMapper + // and we have no access to MapMembershipProperties from the base class without casting protected override IEnumerable GetCustomGenericProperties(IContentBase content) { var member = (IMember)content; diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs index 592c2eff5e..e7a113ed09 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs @@ -54,18 +54,6 @@ namespace Umbraco.Cms.Core.Models.PublishedContent InitializeIndexes(); } - [Obsolete("Use the overload specifying a key instead")] - public PublishedContentType(int id, string alias, PublishedItemType itemType, IEnumerable compositionAliases, IEnumerable propertyTypes, ContentVariation variations, bool isElement = false) - : this (Guid.Empty, id, alias, itemType, compositionAliases, variations, isElement) - { - var propertyTypesA = propertyTypes.ToArray(); - foreach (var propertyType in propertyTypesA) - propertyType.ContentType = this; - _propertyTypes = propertyTypesA; - - InitializeIndexes(); - } - /// /// This constructor is for tests and is not intended to be used directly from application code. /// @@ -80,15 +68,6 @@ namespace Umbraco.Cms.Core.Models.PublishedContent InitializeIndexes(); } - [Obsolete("Use the overload specifying a key instead")] - public PublishedContentType(int id, string alias, PublishedItemType itemType, IEnumerable compositionAliases, Func> propertyTypes, ContentVariation variations, bool isElement = false) - : this(Guid.Empty, id, alias, itemType, compositionAliases, variations, isElement) - { - _propertyTypes = propertyTypes(this).ToArray(); - - InitializeIndexes(); - } - private PublishedContentType(Guid key, int id, string alias, PublishedItemType itemType, IEnumerable compositionAliases, ContentVariation variations, bool isElement) { Key = key; diff --git a/src/Umbraco.Core/Models/RelationType.cs b/src/Umbraco.Core/Models/RelationType.cs index 4c4c69c5f1..f6ee00fc72 100644 --- a/src/Umbraco.Core/Models/RelationType.cs +++ b/src/Umbraco.Core/Models/RelationType.cs @@ -23,13 +23,6 @@ namespace Umbraco.Cms.Core.Models { } - [Obsolete("Use ctor with isDependency parameter")] - public RelationType(string name, string alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType) - :this(name,alias,isBidrectional, parentObjectType, childObjectType, false) - { - - } - public RelationType(string? name, string? alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType, bool isDependency) { if (name == null) throw new ArgumentNullException(nameof(name)); diff --git a/src/Umbraco.Core/Notifications/UmbracoApplicationComponentsInstallingNotification.cs b/src/Umbraco.Core/Notifications/UmbracoApplicationComponentsInstallingNotification.cs deleted file mode 100644 index 7f8d852115..0000000000 --- a/src/Umbraco.Core/Notifications/UmbracoApplicationComponentsInstallingNotification.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Umbraco. -// See LICENSE for more details. - -using System; - -namespace Umbraco.Cms.Core.Notifications -{ - // TODO (V10): Remove this class. - - /// - /// Notification that occurs during the Umbraco boot process, before instances of initialize. - /// - [Obsolete("This notification was added to the core runtime start-up as a hook for Umbraco Cloud local connection string and database setup. " + - "Following re-work they are no longer used (from Deploy 9.2.0)." + - "Given they are non-documented and no other use is expected, they can be removed in the next major release")] - public class UmbracoApplicationComponentsInstallingNotification : INotification - { - /// - /// Initializes a new instance of the class. - /// - /// The runtime level - public UmbracoApplicationComponentsInstallingNotification(RuntimeLevel runtimeLevel) => RuntimeLevel = runtimeLevel; - - /// - /// Gets the runtime level of execution. - /// - public RuntimeLevel RuntimeLevel { get; } - } -} diff --git a/src/Umbraco.Core/Notifications/UmbracoApplicationMainDomAcquiredNotification.cs b/src/Umbraco.Core/Notifications/UmbracoApplicationMainDomAcquiredNotification.cs deleted file mode 100644 index 66593ab086..0000000000 --- a/src/Umbraco.Core/Notifications/UmbracoApplicationMainDomAcquiredNotification.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Umbraco. -// See LICENSE for more details. - -using System; - -namespace Umbraco.Cms.Core.Notifications -{ - // TODO (V10): Remove this class. - - /// - /// Notification that occurs during Umbraco boot after the MainDom has been acquired. - /// - [Obsolete("This notification was added to the core runtime start-up as a hook for Umbraco Cloud local connection string and database setup. " + - "Following re-work they are no longer used (from Deploy 9.2.0)." + - "Given they are non-documented and no other use is expected, they can be removed in the next major release")] - public class UmbracoApplicationMainDomAcquiredNotification : INotification - { - /// - /// Initializes a new instance of the class. - /// - /// The runtime level - public UmbracoApplicationMainDomAcquiredNotification() - { - } - } -} diff --git a/src/Umbraco.Core/Notifications/UmbracoApplicationStartingNotification.cs b/src/Umbraco.Core/Notifications/UmbracoApplicationStartingNotification.cs index 82b87aa3bf..fa5cf1f5e8 100644 --- a/src/Umbraco.Core/Notifications/UmbracoApplicationStartingNotification.cs +++ b/src/Umbraco.Core/Notifications/UmbracoApplicationStartingNotification.cs @@ -8,17 +8,6 @@ namespace Umbraco.Cms.Core.Notifications /// public class UmbracoApplicationStartingNotification : IUmbracoApplicationLifetimeNotification { - /// - /// Initializes a new instance of the class. - /// - /// The runtime level - [Obsolete("Use ctor with all params")] - public UmbracoApplicationStartingNotification(RuntimeLevel runtimeLevel) - : this(runtimeLevel, false) - { - // TODO: Remove this constructor in V10 - } - /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Core/Notifications/UmbracoApplicationStoppingNotification.cs b/src/Umbraco.Core/Notifications/UmbracoApplicationStoppingNotification.cs index 062ca954d9..999b531bc5 100644 --- a/src/Umbraco.Core/Notifications/UmbracoApplicationStoppingNotification.cs +++ b/src/Umbraco.Core/Notifications/UmbracoApplicationStoppingNotification.cs @@ -8,16 +8,6 @@ namespace Umbraco.Cms.Core.Notifications /// public class UmbracoApplicationStoppingNotification : IUmbracoApplicationLifetimeNotification { - /// - /// Initializes a new instance of the class. - /// - [Obsolete("Use ctor with all params")] - public UmbracoApplicationStoppingNotification() - : this(false) - { - // TODO: Remove this constructor in V10 - } - /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Core/Persistence/Repositories/IExternalLoginRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IExternalLoginRepository.cs deleted file mode 100644 index 7d9594a3c6..0000000000 --- a/src/Umbraco.Core/Persistence/Repositories/IExternalLoginRepository.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using Umbraco.Cms.Core.Security; - -namespace Umbraco.Cms.Core.Persistence.Repositories -{ - - public interface IExternalLoginRepository : IReadWriteQueryRepository, IQueryRepository - { - - /// - /// Replaces all external login providers for the user - /// - /// - /// - [Obsolete("Use method that takes guid as param from IExternalLoginWithKeyRepository")] - void Save(int userId, IEnumerable logins); - - /// - /// Replaces all external login provider tokens for the providers specified for the user - /// - /// - /// - [Obsolete("Use method that takes guid as param from IExternalLoginWithKeyRepository")] - void Save(int userId, IEnumerable tokens); - [Obsolete("Use method that takes guid as param from IExternalLoginWithKeyRepository")] - void DeleteUserLogins(int memberId); - } -} diff --git a/src/Umbraco.Core/Persistence/Repositories/IMacroRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IMacroRepository.cs index 44ab86b80a..5db9663f9e 100644 --- a/src/Umbraco.Core/Persistence/Repositories/IMacroRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/IMacroRepository.cs @@ -5,8 +5,8 @@ namespace Umbraco.Cms.Core.Persistence.Repositories { public interface IMacroRepository : IReadWriteQueryRepository, IReadRepository { + IMacro? GetByAlias(string alias); - //IEnumerable GetAll(params string[] aliases); - + IEnumerable GetAllByAlias(string[] aliases); } } diff --git a/src/Umbraco.Core/Persistence/Repositories/IMacroWithAliasRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IMacroWithAliasRepository.cs deleted file mode 100644 index 46705d0ded..0000000000 --- a/src/Umbraco.Core/Persistence/Repositories/IMacroWithAliasRepository.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using Umbraco.Cms.Core.Models; - -namespace Umbraco.Cms.Core.Persistence.Repositories -{ - [Obsolete("This interface will be merged with IMacroRepository in Umbraco 11")] - public interface IMacroWithAliasRepository : IMacroRepository - { - IMacro? GetByAlias(string alias); - - IEnumerable GetAllByAlias(string[] aliases); - } -} diff --git a/src/Umbraco.Core/Persistence/Repositories/IMemberRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IMemberRepository.cs index 28a89ff43a..e3e9af91d7 100644 --- a/src/Umbraco.Core/Persistence/Repositories/IMemberRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/IMemberRepository.cs @@ -40,18 +40,5 @@ namespace Umbraco.Cms.Core.Persistence.Repositories /// /// int GetCountByQuery(IQuery? query); - - /// - /// Sets a members last login date based on their username - /// - /// - /// - /// - /// This is a specialized method because whenever a member logs in, the membership provider requires us to set the 'online' which requires - /// updating their login date. This operation must be fast and cannot use database locks which is fine if we are only executing a single query - /// for this data since there won't be any other data contention issues. - /// - [Obsolete("This is now a NoOp since last login date is no longer an umbraco property, set the date on the IMember directly and Save it instead, scheduled for removal in V11.")] - void SetLastLogin(string username, DateTime date); } } diff --git a/src/Umbraco.Core/Persistence/Repositories/IUserRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IUserRepository.cs index 8357729f38..d5bfa0709c 100644 --- a/src/Umbraco.Core/Persistence/Repositories/IUserRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/IUserRepository.cs @@ -15,14 +15,6 @@ namespace Umbraco.Cms.Core.Persistence.Repositories /// int GetCountByQuery(IQuery? query); - /// - /// Checks if a user with the username exists - /// - /// - /// - [Obsolete("This method will be removed in future versions. Please use ExistsByUserName instead.")] - bool Exists(string username); - /// /// Checks if a user with the username exists /// diff --git a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs index 0442ae1b18..172c65502e 100644 --- a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs +++ b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs @@ -31,13 +31,6 @@ namespace Umbraco.Cms.Core.PropertyEditors } } - [Obsolete("This method is not part of the IPropertyValueConverter contract, therefore not used and will be removed in future versions; use IsValue instead.")] - public virtual bool HasValue(IPublishedProperty property, string culture, string segment) - { - var value = property.GetSourceValue(culture, segment); - return value != null && (!(value is string stringValue) || !string.IsNullOrWhiteSpace(stringValue)); - } - /// public virtual Type GetPropertyValueType(IPublishedPropertyType propertyType) => typeof(object); diff --git a/src/Umbraco.Core/Routing/DefaultUrlProvider.cs b/src/Umbraco.Core/Routing/DefaultUrlProvider.cs index 25e0764349..5db3c024ac 100644 --- a/src/Umbraco.Core/Routing/DefaultUrlProvider.cs +++ b/src/Umbraco.Core/Routing/DefaultUrlProvider.cs @@ -26,14 +26,6 @@ namespace Umbraco.Cms.Core.Routing private readonly IUmbracoContextAccessor _umbracoContextAccessor; private readonly UriUtility _uriUtility; - [Obsolete("Use ctor with all parameters")] - public DefaultUrlProvider(IOptionsMonitor requestSettings, ILogger logger, - ISiteDomainMapper siteDomainMapper, IUmbracoContextAccessor umbracoContextAccessor, UriUtility uriUtility) - : this(requestSettings, logger, siteDomainMapper, umbracoContextAccessor, uriUtility, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - public DefaultUrlProvider( IOptionsMonitor requestSettings, ILogger logger, diff --git a/src/Umbraco.Core/Services/EntityXmlSerializer.cs b/src/Umbraco.Core/Services/EntityXmlSerializer.cs index c91f536b38..00f9dc2a18 100644 --- a/src/Umbraco.Core/Services/EntityXmlSerializer.cs +++ b/src/Umbraco.Core/Services/EntityXmlSerializer.cs @@ -511,7 +511,7 @@ namespace Umbraco.Cms.Core.Services genericProperties, tabs); - if (contentType is IContentTypeWithHistoryCleanup withCleanup && withCleanup.HistoryCleanup is not null) + if (contentType is IContentType withCleanup && withCleanup.HistoryCleanup is not null) { xml.Add(SerializeCleanupPolicy(withCleanup.HistoryCleanup)); } diff --git a/src/Umbraco.Core/Services/ExternalLoginService.cs b/src/Umbraco.Core/Services/ExternalLoginService.cs index d934e89528..9fba54ed16 100644 --- a/src/Umbraco.Core/Services/ExternalLoginService.cs +++ b/src/Umbraco.Core/Services/ExternalLoginService.cs @@ -13,7 +13,7 @@ using Umbraco.Extensions; namespace Umbraco.Cms.Core.Services { - public class ExternalLoginService : RepositoryService, IExternalLoginService, IExternalLoginWithKeyService + public class ExternalLoginService : RepositoryService, IExternalLoginWithKeyService { private readonly IExternalLoginWithKeyRepository _externalLoginRepository; @@ -24,38 +24,6 @@ namespace Umbraco.Cms.Core.Services _externalLoginRepository = externalLoginRepository; } - [Obsolete("Use ctor injecting IExternalLoginWithKeyRepository")] - public ExternalLoginService(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, - IExternalLoginRepository externalLoginRepository) - : this(provider, loggerFactory, eventMessagesFactory, StaticServiceProvider.Instance.GetRequiredService()) - { - } - - /// - [Obsolete("Use overload that takes a user/member key (Guid).")] - public IEnumerable GetExternalLogins(int userId) - => GetExternalLogins(userId.ToGuid()); - - /// - [Obsolete("Use overload that takes a user/member key (Guid).")] - public IEnumerable GetExternalLoginTokens(int userId) => - GetExternalLoginTokens(userId.ToGuid()); - - /// - [Obsolete("Use overload that takes a user/member key (Guid).")] - public void Save(int userId, IEnumerable logins) - => Save(userId.ToGuid(), logins); - - /// - [Obsolete("Use overload that takes a user/member key (Guid).")] - public void Save(int userId, IEnumerable tokens) - => Save(userId.ToGuid(), tokens); - - /// - [Obsolete("Use overload that takes a user/member key (Guid).")] - public void DeleteUserLogins(int userId) - => DeleteUserLogins(userId.ToGuid()); - /// public IEnumerable GetExternalLogins(Guid userOrMemberKey) { diff --git a/src/Umbraco.Core/Services/IExternalLoginService.cs b/src/Umbraco.Core/Services/IExternalLoginService.cs deleted file mode 100644 index 75f8069f0c..0000000000 --- a/src/Umbraco.Core/Services/IExternalLoginService.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using Umbraco.Cms.Core.Security; - -namespace Umbraco.Cms.Core.Services -{ - /// - /// Used to store the external login info - /// - [Obsolete("Use IExternalLoginServiceWithKey. This will be removed in Umbraco 10")] - public interface IExternalLoginService : IService - { - /// - /// Returns all user logins assigned - /// - /// - /// - IEnumerable GetExternalLogins(int userId); - - /// - /// Returns all user login tokens assigned - /// - /// - /// - IEnumerable GetExternalLoginTokens(int userId); - - /// - /// Returns all logins matching the login info - generally there should only be one but in some cases - /// there might be more than one depending on if an administrator has been editing/removing members - /// - /// - /// - /// - IEnumerable Find(string loginProvider, string providerKey); - - /// - /// Saves the external logins associated with the user - /// - /// - /// The user associated with the logins - /// - /// - /// - /// This will replace all external login provider information for the user - /// - void Save(int userId, IEnumerable logins); - - /// - /// Saves the external login tokens associated with the user - /// - /// - /// The user associated with the tokens - /// - /// - /// - /// This will replace all external login tokens for the user - /// - void Save(int userId, IEnumerable tokens); - - /// - /// Deletes all user logins - normally used when a member is deleted - /// - /// - void DeleteUserLogins(int userId); - } -} diff --git a/src/Umbraco.Core/Services/IMacroService.cs b/src/Umbraco.Core/Services/IMacroService.cs index a75547dd6d..c5d553c99a 100644 --- a/src/Umbraco.Core/Services/IMacroService.cs +++ b/src/Umbraco.Core/Services/IMacroService.cs @@ -53,5 +53,12 @@ namespace Umbraco.Cms.Core.Services ///// Alias to retrieve an for ///// An object //IMacroPropertyType GetMacroPropertyTypeByAlias(string alias); + + /// + /// Gets a list of available objects by alias. + /// + /// Optional array of aliases to limit the results + /// An enumerable list of objects + IEnumerable GetAll(params string[] aliases); } } diff --git a/src/Umbraco.Core/Services/IMacroWithAliasService.cs b/src/Umbraco.Core/Services/IMacroWithAliasService.cs deleted file mode 100644 index 6e72777bfa..0000000000 --- a/src/Umbraco.Core/Services/IMacroWithAliasService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using Umbraco.Cms.Core.Models; - -namespace Umbraco.Cms.Core.Services -{ - [Obsolete("This interface will be merged with IMacroService in Umbraco 11")] - public interface IMacroWithAliasService : IMacroService - { - /// - /// Gets a list of available objects by alias. - /// - /// Optional array of aliases to limit the results - /// An enumerable list of objects - IEnumerable GetAll(params string[] aliases); - } -} diff --git a/src/Umbraco.Core/Services/IMembershipMemberService.cs b/src/Umbraco.Core/Services/IMembershipMemberService.cs index 94dbbf3da9..0971738a99 100644 --- a/src/Umbraco.Core/Services/IMembershipMemberService.cs +++ b/src/Umbraco.Core/Services/IMembershipMemberService.cs @@ -108,18 +108,6 @@ namespace Umbraco.Cms.Core.Services /// or to Delete void Delete(T membershipUser); - /// - /// Sets the last login date for the member if they are found by username - /// - /// - /// - /// - /// This is a specialized method because whenever a member logs in, the membership provider requires us to set the 'online' which requires - /// updating their login date. This operation must be fast and cannot use database locks which is fine if we are only executing a single query - /// for this data since there won't be any other data contention issues. - /// - void SetLastLogin(string username, DateTime date); - /// /// Saves an /// diff --git a/src/Umbraco.Core/Services/ITwoFactorLoginService.cs b/src/Umbraco.Core/Services/ITwoFactorLoginService.cs index 30b221742c..a577dcedf7 100644 --- a/src/Umbraco.Core/Services/ITwoFactorLoginService.cs +++ b/src/Umbraco.Core/Services/ITwoFactorLoginService.cs @@ -57,13 +57,15 @@ namespace Umbraco.Cms.Core.Services /// Gets all the enabled 2FA providers for the user or member with the specified key. /// Task> GetEnabledTwoFactorProviderNamesAsync(Guid userOrMemberKey); - } - [Obsolete("This will be merged into ITwoFactorLoginService in Umbraco 11")] - public interface ITwoFactorLoginService2 : ITwoFactorLoginService - { + /// + /// Disables 2FA with Code. + /// Task DisableWithCodeAsync(string providerName, Guid userOrMemberKey, string code); + /// + /// Validates and Saves. + /// Task ValidateAndSaveAsync(string providerName, Guid userKey, string secret, string code); } } diff --git a/src/Umbraco.Core/Services/LocalizedTextService.cs b/src/Umbraco.Core/Services/LocalizedTextService.cs index 6aa7e8fb2b..f02b5771a0 100644 --- a/src/Umbraco.Core/Services/LocalizedTextService.cs +++ b/src/Umbraco.Core/Services/LocalizedTextService.cs @@ -109,12 +109,6 @@ namespace Umbraco.Cms.Core.Services XmlSourceToNoAreaDictionary(source)); } - [Obsolete("Use other ctor with IDictionary>>> as input parameter.")] - public LocalizedTextService(IDictionary>> source, - ILogger logger) : this(source.ToDictionary(x=>x.Key, x=> new Lazy>>(() => x.Value)), logger) - { - - } /// /// Initializes with a source of a dictionary of culture -> areas -> sub dictionary of keys/values /// diff --git a/src/Umbraco.Core/Services/MacroService.cs b/src/Umbraco.Core/Services/MacroService.cs index 6b598921e1..8226ca2f69 100644 --- a/src/Umbraco.Core/Services/MacroService.cs +++ b/src/Umbraco.Core/Services/MacroService.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Core.Services /// /// Represents the Macro Service, which is an easy access to operations involving /// - internal class MacroService : RepositoryService, IMacroWithAliasService + internal class MacroService : RepositoryService, IMacroService { private readonly IMacroRepository _macroRepository; private readonly IAuditRepository _auditRepository; @@ -32,7 +32,7 @@ namespace Umbraco.Cms.Core.Services /// An object public IMacro? GetByAlias(string alias) { - if (_macroRepository is not IMacroWithAliasRepository macroWithAliasRepository) + if (_macroRepository is not IMacroRepository macroWithAliasRepository) { return GetAll().FirstOrDefault(x => x.Alias == alias); } @@ -66,7 +66,7 @@ namespace Umbraco.Cms.Core.Services public IEnumerable GetAll(params string[] aliases) { - if (_macroRepository is not IMacroWithAliasRepository macroWithAliasRepository) + if (_macroRepository is not IMacroRepository macroWithAliasRepository) { var hashset = new HashSet(aliases); return GetAll().Where(x => hashset.Contains(x.Alias)); diff --git a/src/Umbraco.Core/Services/MemberService.cs b/src/Umbraco.Core/Services/MemberService.cs index 2a4498f7e4..32b8961143 100644 --- a/src/Umbraco.Core/Services/MemberService.cs +++ b/src/Umbraco.Core/Services/MemberService.cs @@ -747,12 +747,6 @@ namespace Umbraco.Cms.Core.Services #region Save - /// - [Obsolete("This is now a NoOp since last login date is no longer an umbraco property, set the date on the IMember directly and Save it instead, scheduled for removal in V11.")] - public void SetLastLogin(string username, DateTime date) - { - } - /// public void Save(IMember member) { diff --git a/src/Umbraco.Core/Services/ServiceContext.cs b/src/Umbraco.Core/Services/ServiceContext.cs index 20774bd7a2..ea419f99f8 100644 --- a/src/Umbraco.Core/Services/ServiceContext.cs +++ b/src/Umbraco.Core/Services/ServiceContext.cs @@ -29,7 +29,7 @@ namespace Umbraco.Cms.Core.Services private readonly Lazy? _memberTypeService; private readonly Lazy? _memberGroupService; private readonly Lazy? _notificationService; - private readonly Lazy? _externalLoginService; + private readonly Lazy? _externalLoginService; private readonly Lazy? _redirectUrlService; private readonly Lazy? _consentService; private readonly Lazy? _keyValueService; @@ -38,7 +38,7 @@ namespace Umbraco.Cms.Core.Services /// /// Initializes a new instance of the class with lazy services. /// - public ServiceContext(Lazy? publicAccessService, Lazy? domainService, Lazy? auditService, Lazy? localizedTextService, Lazy? tagService, Lazy? contentService, Lazy? userService, Lazy? memberService, Lazy? mediaService, Lazy? contentTypeService, Lazy? mediaTypeService, Lazy? dataTypeService, Lazy? fileService, Lazy? localizationService, Lazy? packagingService, Lazy? serverRegistrationService, Lazy? entityService, Lazy? relationService, Lazy? macroService, Lazy? memberTypeService, Lazy? memberGroupService, Lazy? notificationService, Lazy? externalLoginService, Lazy? redirectUrlService, Lazy? consentService, Lazy? keyValueService, Lazy? contentTypeBaseServiceProvider) + public ServiceContext(Lazy? publicAccessService, Lazy? domainService, Lazy? auditService, Lazy? localizedTextService, Lazy? tagService, Lazy? contentService, Lazy? userService, Lazy? memberService, Lazy? mediaService, Lazy? contentTypeService, Lazy? mediaTypeService, Lazy? dataTypeService, Lazy? fileService, Lazy? localizationService, Lazy? packagingService, Lazy? serverRegistrationService, Lazy? entityService, Lazy? relationService, Lazy? macroService, Lazy? memberTypeService, Lazy? memberGroupService, Lazy? notificationService, Lazy? externalLoginService, Lazy? redirectUrlService, Lazy? consentService, Lazy? keyValueService, Lazy? contentTypeBaseServiceProvider) { _publicAccessService = publicAccessService; _domainService = domainService; @@ -97,7 +97,7 @@ namespace Umbraco.Cms.Core.Services IDomainService? domainService = null, IMacroService? macroService = null, IPublicAccessService? publicAccessService = null, - IExternalLoginService? externalLoginService = null, + IExternalLoginWithKeyService? externalLoginService = null, IServerRegistrationService? serverRegistrationService = null, IRedirectUrlService? redirectUrlService = null, IConsentService? consentService = null, @@ -250,7 +250,7 @@ namespace Umbraco.Cms.Core.Services /// /// Gets the ExternalLoginService. /// - public IExternalLoginService? ExternalLoginService => _externalLoginService?.Value; + public IExternalLoginWithKeyService? ExternalLoginService => _externalLoginService?.Value; /// /// Gets the RedirectUrlService. diff --git a/src/Umbraco.Core/Services/TwoFactorLoginService.cs b/src/Umbraco.Core/Services/TwoFactorLoginService.cs index 7a4feb91fb..426d100e93 100644 --- a/src/Umbraco.Core/Services/TwoFactorLoginService.cs +++ b/src/Umbraco.Core/Services/TwoFactorLoginService.cs @@ -15,7 +15,7 @@ using Umbraco.Cms.Web.Common.DependencyInjection; namespace Umbraco.Cms.Core.Services { /// - public class TwoFactorLoginService : ITwoFactorLoginService2 + public class TwoFactorLoginService : ITwoFactorLoginService { private readonly ITwoFactorLoginRepository _twoFactorLoginRepository; private readonly ICoreScopeProvider _scopeProvider; @@ -43,23 +43,6 @@ namespace Umbraco.Cms.Core.Services _twoFactorSetupGenerators = twoFactorSetupGenerators.ToDictionary(x =>x.ProviderName); } - [Obsolete("Use ctor with all params - This will be removed in v11")] - public TwoFactorLoginService( - ITwoFactorLoginRepository twoFactorLoginRepository, - ICoreScopeProvider scopeProvider, - IEnumerable twoFactorSetupGenerators, - IOptions identityOptions, - IOptions backOfficeIdentityOptions) - : this(twoFactorLoginRepository, - scopeProvider, - twoFactorSetupGenerators, - identityOptions, - backOfficeIdentityOptions, - StaticServiceProvider.Instance.GetRequiredService>()) - { - - } - /// public async Task DeleteUserLoginsAsync(Guid userOrMemberKey) { diff --git a/src/Umbraco.Core/Services/UserService.cs b/src/Umbraco.Core/Services/UserService.cs index f0b5cc6a32..9dfc09d6d7 100644 --- a/src/Umbraco.Core/Services/UserService.cs +++ b/src/Umbraco.Core/Services/UserService.cs @@ -266,13 +266,6 @@ namespace Umbraco.Cms.Core.Services } } - // explicit implementation because we don't need it now but due to the way that the members membership provider is put together - // this method must exist in this service as an implementation (legacy) - void IMembershipMemberService.SetLastLogin(string username, DateTime date) - { - _logger.LogWarning("This method is not implemented. Using membership providers users is not advised, use ASP.NET Identity instead. See issue #9224 for more information."); - } - /// /// Saves an /// diff --git a/src/Umbraco.Core/WebAssets/IRuntimeMinifier.cs b/src/Umbraco.Core/WebAssets/IRuntimeMinifier.cs index baf9549562..92b9e1e423 100644 --- a/src/Umbraco.Core/WebAssets/IRuntimeMinifier.cs +++ b/src/Umbraco.Core/WebAssets/IRuntimeMinifier.cs @@ -84,22 +84,5 @@ namespace Umbraco.Cms.Core.WebAssets /// /// Task MinifyAsync(string? fileContent, AssetType assetType); - - /// - /// Ensures that all runtime minifications are refreshed on next request. E.g. Clearing cache. - /// - /// - /// - /// No longer necessary, invalidation occurs automatically if any of the following occur. - /// - /// - /// Your sites assembly information version changes. - /// Umbraco.Cms.Core assembly information version changes. - /// RuntimeMinificationSettings Version string changes. - /// - /// for further details. - /// - [Obsolete("Invalidation is handled automatically. Scheduled for removal V11.")] - void Reset(); } } diff --git a/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs b/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs index 48c0540c67..c39ab7c8c6 100644 --- a/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs +++ b/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs @@ -18,11 +18,6 @@ namespace Umbraco.Cms.Core.Configuration private readonly ILogger _logger; private readonly object _locker = new object(); - [Obsolete] - public JsonConfigManipulator(IConfiguration configuration) - : this(configuration, StaticServiceProvider.Instance.GetRequiredService>()) - { } - public JsonConfigManipulator( IConfiguration configuration, ILogger logger) diff --git a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs index 9d85594eb2..28dde10329 100644 --- a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs +++ b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs @@ -33,8 +33,7 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection builder.Services.AddUnique(); builder.Services.AddMultipleUnique(); builder.Services.AddUnique(); - builder.Services.AddUnique(); - builder.Services.AddUnique(factory => factory.GetRequiredService()); + builder.Services.AddSingleton(); builder.Services.AddUnique(factory => factory.GetRequiredService()); builder.Services.AddUnique(); builder.Services.AddUnique(); diff --git a/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs b/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs index 4888d173d7..f0903ff65f 100644 --- a/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs +++ b/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs @@ -42,12 +42,6 @@ namespace Umbraco.Cms.Infrastructure.HostedServices _delay = delay; } - // Scheduled for removal in V11 - [Obsolete("Please use constructor that takes an ILogger instead")] - protected RecurringHostedServiceBase(TimeSpan period, TimeSpan delay) - : this(null, period, delay) - { } - /// /// Change the period between operations. /// diff --git a/src/Umbraco.Infrastructure/HostedServices/ReportSiteTask.cs b/src/Umbraco.Infrastructure/HostedServices/ReportSiteTask.cs index 54137fad99..5179d3f2e1 100644 --- a/src/Umbraco.Infrastructure/HostedServices/ReportSiteTask.cs +++ b/src/Umbraco.Infrastructure/HostedServices/ReportSiteTask.cs @@ -30,15 +30,6 @@ namespace Umbraco.Cms.Infrastructure.HostedServices s_httpClient = new HttpClient(); } - [Obsolete("Use the constructor that takes ITelemetryService instead, scheduled for removal in V11")] - public ReportSiteTask( - ILogger logger, - IUmbracoVersion umbracoVersion, - IOptions globalSettings) - : this(logger, StaticServiceProvider.Instance.GetRequiredService()) - { - } - /// /// Runs the background task to send the anonymous ID /// to telemetry service diff --git a/src/Umbraco.Infrastructure/Logging/Viewer/ILogViewer.cs b/src/Umbraco.Infrastructure/Logging/Viewer/ILogViewer.cs index 2bda63c96b..2fd357d5a2 100644 --- a/src/Umbraco.Infrastructure/Logging/Viewer/ILogViewer.cs +++ b/src/Umbraco.Infrastructure/Logging/Viewer/ILogViewer.cs @@ -43,13 +43,6 @@ namespace Umbraco.Cms.Core.Logging.Viewer bool CheckCanOpenLogs(LogTimePeriod logTimePeriod); - /// - /// Gets the current Serilog minimum log level - /// - /// - [Obsolete("Please use GetLogLevels() instead. Scheduled for removal in V11.")] - string GetLogLevel(); - /// /// Returns the collection of logs /// diff --git a/src/Umbraco.Infrastructure/Logging/Viewer/SerilogLogViewerSourceBase.cs b/src/Umbraco.Infrastructure/Logging/Viewer/SerilogLogViewerSourceBase.cs index ca5c5c3a46..bb362e30b8 100644 --- a/src/Umbraco.Infrastructure/Logging/Viewer/SerilogLogViewerSourceBase.cs +++ b/src/Umbraco.Infrastructure/Logging/Viewer/SerilogLogViewerSourceBase.cs @@ -16,14 +16,6 @@ namespace Umbraco.Cms.Core.Logging.Viewer private readonly ILogLevelLoader _logLevelLoader; private readonly global::Serilog.ILogger _serilogLog; - [Obsolete("Please use ctor with all params instead. Scheduled for removal in V11.")] - protected SerilogLogViewerSourceBase(ILogViewerConfig logViewerConfig, global::Serilog.ILogger serilogLog) - { - _logViewerConfig = logViewerConfig; - _logLevelLoader = StaticServiceProvider.Instance.GetRequiredService(); - _serilogLog = serilogLog; - } - protected SerilogLogViewerSourceBase(ILogViewerConfig logViewerConfig, ILogLevelLoader logLevelLoader, global::Serilog.ILogger serilogLog) { _logViewerConfig = logViewerConfig; @@ -64,16 +56,6 @@ namespace Umbraco.Cms.Core.Logging.Viewer return _logLevelLoader.GetLogLevelsFromSinks(); } - /// - /// Get the Serilog minimum-level value from the config file. - /// - [Obsolete("Please use LogLevelLoader.GetGlobalMinLogLevel() instead. Scheduled for removal in V11.")] - public string GetLogLevel() - { - var logLevel = Enum.GetValues(typeof(LogEventLevel)).Cast().Where(_serilogLog.IsEnabled).DefaultIfEmpty(LogEventLevel.Information)?.Min() ?? null; - return logLevel?.ToString() ?? string.Empty; - } - public LogLevelCounts GetLogLevelCounts(LogTimePeriod logTimePeriod) { var counter = new CountingFilter(); diff --git a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs index d4527909e9..0b296b2d77 100644 --- a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs +++ b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs @@ -96,17 +96,6 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install private readonly IUmbracoVersion _umbracoVersion; private readonly IOptionsMonitor _defaultDataCreationSettings; - [Obsolete("Please use constructor taking all parameters. Scheduled for removal in V11.")] - public DatabaseSchemaCreator( - IUmbracoDatabase? database, - ILogger logger, - ILoggerFactory loggerFactory, - IUmbracoVersion umbracoVersion, - IEventAggregator eventAggregator) - : this (database, logger, loggerFactory, umbracoVersion, eventAggregator, StaticServiceProvider.Instance.GetRequiredService>()) - { - } - public DatabaseSchemaCreator( IUmbracoDatabase? database, ILogger logger, diff --git a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreatorFactory.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreatorFactory.cs index d4d0507c0a..7e5fdf11f9 100644 --- a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreatorFactory.cs +++ b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreatorFactory.cs @@ -21,16 +21,6 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install private readonly IEventAggregator _eventAggregator; private readonly IOptionsMonitor _installDefaultDataSettings; - [Obsolete("Please use the constructor taking all parameters. Scheduled for removal in V11.")] - public DatabaseSchemaCreatorFactory( - ILogger logger, - ILoggerFactory loggerFactory, - IUmbracoVersion umbracoVersion, - IEventAggregator eventAggregator) - : this(logger, loggerFactory, umbracoVersion, eventAggregator, StaticServiceProvider.Instance.GetRequiredService>()) - { - } - public DatabaseSchemaCreatorFactory( ILogger logger, ILoggerFactory loggerFactory, diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs index 69431867b1..bfbe0434bf 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs @@ -77,9 +77,11 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0 .From() .Where(x => x.DataTypeId == Cms.Core.Constants.DataTypes.LabelString)); - var intPropertyAliases = new[] { Cms.Core.Constants.Conventions.Media.Width, Cms.Core.Constants.Conventions.Media.Height, Cms.Core.Constants.Conventions.Member.FailedPasswordAttempts }; + // member properties are no longer used in v10, so just added strings here instead of constants + // these migrations should be removed anyways for v11 + var intPropertyAliases = new[] { Cms.Core.Constants.Conventions.Media.Width, Cms.Core.Constants.Conventions.Media.Height, "umbracoMemberFailedPasswordAttempts" }; var bigintPropertyAliases = new[] { Cms.Core.Constants.Conventions.Media.Bytes }; - var dtPropertyAliases = new[] { Cms.Core.Constants.Conventions.Member.LastLockoutDate, Cms.Core.Constants.Conventions.Member.LastLoginDate, Cms.Core.Constants.Conventions.Member.LastPasswordChangeDate }; + var dtPropertyAliases = new[] { "umbracoMemberLastLockoutDate", "umbracoMemberLastLogin", "umbracoMemberLastPasswordChangeDate" }; var intPropertyTypes = labelPropertyTypes.Where(pt => intPropertyAliases.Contains(pt.Alias)).Select(pt => pt.Id).ToArray(); var bigintPropertyTypes = labelPropertyTypes.Where(pt => bigintPropertyAliases.Contains(pt.Alias)).Select(pt => pt.Id).ToArray(); diff --git a/src/Umbraco.Infrastructure/Packaging/AutomaticPackageMigrationPlan.cs b/src/Umbraco.Infrastructure/Packaging/AutomaticPackageMigrationPlan.cs index 92e1086fbd..fef8bfeba6 100644 --- a/src/Umbraco.Infrastructure/Packaging/AutomaticPackageMigrationPlan.cs +++ b/src/Umbraco.Infrastructure/Packaging/AutomaticPackageMigrationPlan.cs @@ -1,4 +1,6 @@ using System; +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.IO; using Umbraco.Cms.Core.Packaging; using Umbraco.Cms.Core.PropertyEditors; @@ -34,7 +36,7 @@ namespace Umbraco.Cms.Infrastructure.Packaging private class MigrateToPackageData : PackageMigrationBase { - public MigrateToPackageData(IPackagingService packagingService, IMediaService mediaService, MediaFileManager mediaFileManager, MediaUrlGeneratorCollection mediaUrlGenerators, IShortStringHelper shortStringHelper, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IMigrationContext context) : base(packagingService, mediaService, mediaFileManager, mediaUrlGenerators, shortStringHelper, contentTypeBaseServiceProvider, context) + public MigrateToPackageData(IPackagingService packagingService, IMediaService mediaService, MediaFileManager mediaFileManager, MediaUrlGeneratorCollection mediaUrlGenerators, IShortStringHelper shortStringHelper, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IMigrationContext context, IOptions options) : base(packagingService, mediaService, mediaFileManager, mediaUrlGenerators, shortStringHelper, contentTypeBaseServiceProvider, context, options) { } diff --git a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs index f0bca5f1ea..a45c26a44d 100644 --- a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs +++ b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs @@ -890,7 +890,7 @@ namespace Umbraco.Cms.Infrastructure.Packaging UpdateContentTypesPropertyGroups(contentType, documentType.Element("Tabs")); UpdateContentTypesProperties(contentType, documentType.Element("GenericProperties")); - if (contentType is IContentTypeWithHistoryCleanup withCleanup) + if (contentType is IContentType withCleanup) { UpdateHistoryCleanupPolicy(withCleanup, documentType.Element("HistoryCleanupPolicy")); } @@ -898,7 +898,7 @@ namespace Umbraco.Cms.Infrastructure.Packaging return contentType; } - private void UpdateHistoryCleanupPolicy(IContentTypeWithHistoryCleanup withCleanup, XElement? element) + private void UpdateHistoryCleanupPolicy(IContentType withCleanup, XElement? element) { if (element == null) { diff --git a/src/Umbraco.Infrastructure/Packaging/PackageMigrationBase.cs b/src/Umbraco.Infrastructure/Packaging/PackageMigrationBase.cs index 54b96955d4..f39277975d 100644 --- a/src/Umbraco.Infrastructure/Packaging/PackageMigrationBase.cs +++ b/src/Umbraco.Infrastructure/Packaging/PackageMigrationBase.cs @@ -42,28 +42,6 @@ namespace Umbraco.Cms.Infrastructure.Packaging _packageMigrationsSettings = packageMigrationsSettings; } - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Use ctor with all params")] - public PackageMigrationBase( - IPackagingService packagingService, - IMediaService mediaService, - MediaFileManager mediaFileManager, - MediaUrlGeneratorCollection mediaUrlGenerators, - IShortStringHelper shortStringHelper, - IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, - IMigrationContext context) - : this( - packagingService, - mediaService, - mediaFileManager, - mediaUrlGenerators, - shortStringHelper, - contentTypeBaseServiceProvider, - context, - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - public IImportPackageBuilder ImportPackage => BeginBuild( new ImportPackageBuilder( _packagingService, diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs index 9e2f0257b6..9859b1e69a 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs @@ -302,7 +302,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement { // historyCleanup property is not mandatory for api endpoint, handle the case where it's not present. // DocumentTypeSave doesn't handle this for us like ContentType constructors do. - if (entity is IContentTypeWithHistoryCleanup entityWithHistoryCleanup) + if (entity is IContentType entityWithHistoryCleanup) { ContentVersionCleanupPolicyDto dto = new ContentVersionCleanupPolicyDto() { diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs index 9739c9a295..16933d7e96 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs @@ -17,24 +17,12 @@ using Umbraco.Extensions; namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement { - internal class ExternalLoginRepository : EntityRepositoryBase, IExternalLoginRepository, IExternalLoginWithKeyRepository + internal class ExternalLoginRepository : EntityRepositoryBase, IExternalLoginWithKeyRepository { public ExternalLoginRepository(IScopeAccessor scopeAccessor, AppCaches cache, ILogger logger) : base(scopeAccessor, cache, logger) { } - /// - [Obsolete("Use method that takes guid as param")] - public void DeleteUserLogins(int memberId) => DeleteUserLogins(memberId.ToGuid()); - - /// - [Obsolete("Use method that takes guid as param")] - public void Save(int userId, IEnumerable logins) => Save(userId.ToGuid(), logins); - - /// - [Obsolete("Use method that takes guid as param")] - public void Save(int userId, IEnumerable tokens) => Save(userId.ToGuid(), tokens); - /// public void DeleteUserLogins(Guid userOrMemberKey) => Database.Delete("WHERE userOrMemberKey=@userOrMemberKey", new { userOrMemberKey }); diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MacroRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MacroRepository.cs index a918590a0c..158906df20 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MacroRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MacroRepository.cs @@ -18,7 +18,7 @@ using Umbraco.Extensions; namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement { - internal class MacroRepository : EntityRepositoryBase, IMacroWithAliasRepository + internal class MacroRepository : EntityRepositoryBase, IMacroRepository { private readonly IShortStringHelper _shortStringHelper; private readonly IRepositoryCachePolicy _macroByAliasCachePolicy; diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberRepository.cs index 9c41482436..198468ddba 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberRepository.cs @@ -210,14 +210,6 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement return Database.ExecuteScalar(fullSql); } - /// - [Obsolete( - "This is now a NoOp since last login date is no longer an umbraco property, set the date on the IMember directly and Save it instead, scheduled for removal in V11.")] - public void SetLastLogin(string username, DateTime date) - { - - } - /// /// Gets paged member results. /// diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/UserRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/UserRepository.cs index 5f44dc6781..0737d89af4 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/UserRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/UserRepository.cs @@ -692,11 +692,6 @@ SELECT 4 AS [Key], COUNT(id) AS [Value] FROM umbracoUser WHERE userDisabled = 0 return Database.ExecuteScalar(sql); } - public bool Exists(string username) - { - return ExistsByUserName(username); - } - public bool ExistsByUserName(string username) { var sql = SqlContext.Sql() diff --git a/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs b/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs index 5866589c6f..6e01d2b260 100644 --- a/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs +++ b/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs @@ -169,9 +169,6 @@ namespace Umbraco.Cms.Infrastructure.Runtime // Acquire the main domain - if this fails then anything that should be registered with MainDom will not operate AcquireMainDom(); - // TODO (V10): Remove this obsoleted notification publish. - await _eventAggregator.PublishAsync(new UmbracoApplicationMainDomAcquiredNotification(), cancellationToken); - // Notify for unattended install await _eventAggregator.PublishAsync(new RuntimeUnattendedInstallNotification(), cancellationToken); DetermineRuntimeLevel(); @@ -210,9 +207,6 @@ namespace Umbraco.Cms.Infrastructure.Runtime break; } - // TODO (V10): Remove this obsoleted notification publish - await _eventAggregator.PublishAsync(new UmbracoApplicationComponentsInstallingNotification(State.Level), cancellationToken); - // Initialize the components _components.Initialize(); diff --git a/src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs b/src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs index c91dda8890..284114dcd4 100644 --- a/src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs +++ b/src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs @@ -89,30 +89,6 @@ namespace Umbraco.Cms.Core.Security } - [Obsolete("Use non obsolete ctor")] - public BackOfficeUserStore( - ICoreScopeProvider scopeProvider, - IUserService userService, - IEntityService entityService, - IExternalLoginService externalLoginService, - IOptions globalSettings, - IUmbracoMapper mapper, - BackOfficeErrorDescriber describer, - AppCaches appCaches) - : this( - scopeProvider, - userService, - entityService, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService>(), - mapper, - describer, - appCaches, - StaticServiceProvider.Instance.GetRequiredService()) - { - - } - /// public override async Task GetTwoFactorEnabledAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = default(CancellationToken)) diff --git a/src/Umbraco.Infrastructure/Security/MemberUserStore.cs b/src/Umbraco.Infrastructure/Security/MemberUserStore.cs index 87eb5f363e..7812075f8d 100644 --- a/src/Umbraco.Infrastructure/Security/MemberUserStore.cs +++ b/src/Umbraco.Infrastructure/Security/MemberUserStore.cs @@ -68,7 +68,7 @@ namespace Umbraco.Cms.Core.Security ICoreScopeProvider scopeProvider, IdentityErrorDescriber describer, IPublishedSnapshotAccessor publishedSnapshotAccessor, - IExternalLoginService externalLoginService) + IExternalLoginWithKeyService externalLoginService) : this(memberService, mapper, scopeProvider, describer, publishedSnapshotAccessor, StaticServiceProvider.Instance.GetRequiredService(), StaticServiceProvider.Instance.GetRequiredService()) { diff --git a/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs b/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs index 7522585f47..693fbfbadd 100644 --- a/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs +++ b/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs @@ -74,7 +74,7 @@ namespace Umbraco.Cms.Infrastructure.Templates private IEnumerable GetUmbracoEntityReferencesFromMacros(List>> macros) { - if (_macroService is not IMacroWithAliasService macroWithAliasService) + if (_macroService is not IMacroService macroWithAliasService) { yield break; } diff --git a/src/Umbraco.PublishedCache.NuCache/ContentNodeKit.cs b/src/Umbraco.PublishedCache.NuCache/ContentNodeKit.cs index d845621db9..41aa9ff5b8 100644 --- a/src/Umbraco.PublishedCache.NuCache/ContentNodeKit.cs +++ b/src/Umbraco.PublishedCache.NuCache/ContentNodeKit.cs @@ -7,17 +7,13 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache { public struct ContentNodeKit { - [Obsolete("This will be changed to a property in future versions")] - public ContentNode Node = null!; + public ContentNode Node { get; } = null!; - [Obsolete("This will be changed to a property in future versions")] - public int ContentTypeId; + public int ContentTypeId { get; } - [Obsolete("This will be changed to a property in future versions")] - public ContentData? DraftData; + public ContentData? DraftData { get; } - [Obsolete("This will be changed to a property in future versions")] - public ContentData? PublishedData; + public ContentData? PublishedData { get; } public ContentNodeKit(ContentNode node, int contentTypeId, ContentData? draftData, ContentData? publishedData) { diff --git a/src/Umbraco.PublishedCache.NuCache/DataSource/ContentData.cs b/src/Umbraco.PublishedCache.NuCache/DataSource/ContentData.cs index cc53e4d047..1de69e0d0c 100644 --- a/src/Umbraco.PublishedCache.NuCache/DataSource/ContentData.cs +++ b/src/Umbraco.PublishedCache.NuCache/DataSource/ContentData.cs @@ -9,16 +9,6 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource /// public class ContentData { - // Scheduled for removal in V11 - [Obsolete("Use ctor with all params, as the pros should be immutable")] - public ContentData() - { - Name = string.Empty; - UrlSegment = string.Empty; - Properties = null!; - CultureInfos = null!; - } - public ContentData(string? name, string? urlSegment, int versionId, DateTime versionDate, int writerId, int? templateId, bool published, IDictionary? properties, IReadOnlyDictionary? cultureInfos) { Name = name ?? throw new ArgumentNullException(nameof(name)); @@ -32,19 +22,19 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource CultureInfos = cultureInfos; } - public string Name { get; [Obsolete("Do not change this, use ctor with params and have this object immutable.")] set; } - public string? UrlSegment { get; [Obsolete("Do not change this, use ctor with params and have this object immutable.")] set; } - public int VersionId { get; [Obsolete("Do not change this, use ctor with params and have this object immutable.")] set; } - public DateTime VersionDate { get; [Obsolete("Do not change this, use ctor with params and have this object immutable.")] set; } - public int WriterId { get; [Obsolete("Do not change this, use ctor with params and have this object immutable.")] set; } - public int? TemplateId { get; [Obsolete("Do not change this, use ctor with params and have this object immutable.")] set; } - public bool Published { get; [Obsolete("Do not change this, use ctor with params and have this object immutable.")] set; } + public string Name { get; } + public string? UrlSegment { get; } + public int VersionId { get; } + public DateTime VersionDate { get; } + public int WriterId { get; } + public int? TemplateId { get; } + public bool Published { get; } - public IDictionary Properties { get; [Obsolete("Do not change this, use ctor with params and have this object immutable.")] set; } + public IDictionary Properties { get; } /// /// The collection of language Id to name for the content item /// - public IReadOnlyDictionary? CultureInfos { get; [Obsolete("Do not change this, use ctor with params and have this object immutable.")] set; } + public IReadOnlyDictionary? CultureInfos { get; } } } diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs index 79765f20bc..83dd050d9e 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs @@ -290,7 +290,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers }, { "memberTypeApiBaseUrl", _linkGenerator.GetUmbracoApiServiceBaseUrl( - controller => controller.GetAllTypes()) + controller => controller.GetById(0)) }, { "memberTypeQueryApiBaseUrl", _linkGenerator.GetUmbracoApiServiceBaseUrl( diff --git a/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs b/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs index 0084c0680d..ac8b96af10 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs @@ -84,39 +84,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers _userDataService = userDataService; } - [Obsolete("This constructor is obsolete and will be removed in v11, use constructor with all values")] - public CurrentUserController( - MediaFileManager mediaFileManager, - IOptions contentSettings, - IHostingEnvironment hostingEnvironment, - IImageUrlGenerator imageUrlGenerator, - IBackOfficeSecurityAccessor backofficeSecurityAccessor, - IUserService userService, - IUmbracoMapper umbracoMapper, - IBackOfficeUserManager backOfficeUserManager, - ILoggerFactory loggerFactory, - ILocalizedTextService localizedTextService, - AppCaches appCaches, - IShortStringHelper shortStringHelper, - IPasswordChanger passwordChanger) : this( - mediaFileManager, - StaticServiceProvider.Instance.GetRequiredService>(), - hostingEnvironment, - imageUrlGenerator, - backofficeSecurityAccessor, - userService, - umbracoMapper, - backOfficeUserManager, - localizedTextService, - appCaches, - shortStringHelper, - passwordChanger, - StaticServiceProvider.Instance.GetRequiredService()) - { - - } - - /// /// Returns permissions for all nodes passed in for the current user /// diff --git a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs index a3716f53aa..864c251b78 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs @@ -476,46 +476,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers }).ToDictionary(x => x.Id, x => x.Url); } - /// - /// Get entity URLs by UDIs - /// - /// - /// A list of UDIs to lookup items by - /// - /// The culture to fetch the URL for - /// Dictionary mapping Udi -> Url - /// - /// We allow for POST because there could be quite a lot of Ids. - /// - [HttpGet] - [HttpPost] - [Obsolete("Use GetUrlsByIds instead.")] - public IDictionary GetUrlsByUdis([FromJsonPath] Udi[] udis, string? culture = null) - { - if (udis == null || !udis.Any()) - { - return new Dictionary(); - } - - var udiEntityType = udis.First().EntityType; - UmbracoEntityTypes entityType; - - switch (udiEntityType) - { - case Constants.UdiEntityType.Document: - entityType = UmbracoEntityTypes.Document; - break; - case Constants.UdiEntityType.Media: - entityType = UmbracoEntityTypes.Media; - break; - default: - entityType = (UmbracoEntityTypes)(-1); - break; - } - - return GetUrlsByIds(udis, entityType, culture); - } - /// /// Gets the URL of an entity /// diff --git a/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs b/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs index f7bdd519e1..48b8de1b99 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs @@ -22,12 +22,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers private readonly ILogger _logger; private HelpPageSettings? _helpPageSettings; - [Obsolete("Use constructor that takes IOptions")] - public HelpController(ILogger logger) - : this(logger, StaticServiceProvider.Instance.GetRequiredService>()) - { - } - [ActivatorUtilitiesConstructor] public HelpController( ILogger logger, diff --git a/src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs b/src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs index 1ed6efe9c6..35c8c84927 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs @@ -31,11 +31,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers _umbracoMapper = umbracoMapper ?? throw new ArgumentNullException(nameof(umbracoMapper)); } - [Obsolete("Use the constructor without global settings instead, scheduled for removal in V11.")] - public LanguageController(ILocalizationService localizationService, IUmbracoMapper umbracoMapper, IOptionsSnapshot globalSettings) - : this(localizationService, umbracoMapper) - { } - /// /// Returns all cultures available for creating languages. /// diff --git a/src/Umbraco.Web.BackOffice/Controllers/LogViewerController.cs b/src/Umbraco.Web.BackOffice/Controllers/LogViewerController.cs index 4e562fca60..19247d8a88 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/LogViewerController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/LogViewerController.cs @@ -26,12 +26,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers private readonly ILogViewer _logViewer; private readonly ILogLevelLoader _logLevelLoader; - [Obsolete] - public LogViewerController(ILogViewer logViewer) - : this(logViewer, StaticServiceProvider.Instance.GetRequiredService()) - { - } - [ActivatorUtilitiesConstructor] public LogViewerController(ILogViewer logViewer, ILogLevelLoader logLevelLoader) { @@ -153,12 +147,5 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers { return _logLevelLoader.GetLogLevelsFromSinks(); } - - [Obsolete("Please use GetLogLevels() instead. Scheduled for removal in V11.")] - [HttpGet] - public string GetLogLevel() - { - return _logViewer.GetLogLevel(); - } } } diff --git a/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs b/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs index ce0bb9846b..15872e12c9 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs @@ -1096,32 +1096,5 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers return new ActionResult(toMove); } - - [Obsolete("Please use TrackedReferencesController.GetPagedRelationsForItem() instead. Scheduled for removal in V11.")] - public PagedResult GetPagedReferences(int id, string entityType, int pageNumber = 1, int pageSize = 100) - { - if (pageNumber <= 0 || pageSize <= 0) - { - throw new NotSupportedException("Both pageNumber and pageSize must be greater than zero"); - } - - var objectType = ObjectTypes.GetUmbracoObjectType(entityType); - var udiType = ObjectTypes.GetUdiType(objectType); - - var relations = _relationService.GetPagedParentEntitiesByChildId(id, pageNumber - 1, pageSize, out var totalRecords, objectType); - - return new PagedResult(totalRecords, pageNumber, pageSize) - { - Items = relations.Cast().Select(rel => new EntityBasic - { - Id = rel.Id, - Key = rel.Key, - Udi = Udi.Create(udiType, rel.Key), - Icon = rel.ContentTypeIcon, - Name = rel.Name, - Alias = rel.ContentTypeAlias - }) - }; - } } } diff --git a/src/Umbraco.Web.BackOffice/Controllers/MemberTypeController.cs b/src/Umbraco.Web.BackOffice/Controllers/MemberTypeController.cs index a73fb442ca..6a895ba9a0 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/MemberTypeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/MemberTypeController.cs @@ -178,18 +178,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers return dto; } - - /// - /// Returns all member types - /// - [Obsolete("Use MemberTypeQueryController.GetAllTypes instead as it only requires AuthorizationPolicies.TreeAccessMembersOrMemberTypes and not both this and AuthorizationPolicies.TreeAccessMemberTypes")] - [Authorize(Policy = AuthorizationPolicies.TreeAccessMembersOrMemberTypes)] - public IEnumerable GetAllTypes() - { - return _memberTypeService.GetAll() - .Select(_umbracoMapper.Map).WhereNotNull(); - } - public ActionResult PostSave(MemberTypeSave contentTypeSave) { //get the persisted member type diff --git a/src/Umbraco.Web.BackOffice/Controllers/TemplateController.cs b/src/Umbraco.Web.BackOffice/Controllers/TemplateController.cs index 65052df636..833bcee9e8 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/TemplateController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/TemplateController.cs @@ -42,15 +42,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers _defaultViewContentProvider = defaultViewContentProvider ?? throw new ArgumentNullException(nameof(defaultViewContentProvider)); } - [Obsolete("Use ctor will all params")] - public TemplateController( - IFileService fileService, - IUmbracoMapper umbracoMapper, - IShortStringHelper shortStringHelper) - : this(fileService, umbracoMapper, shortStringHelper, StaticServiceProvider.Instance.GetRequiredService()) - { - } - /// /// Gets data type by alias /// diff --git a/src/Umbraco.Web.BackOffice/Controllers/TwoFactorLoginController.cs b/src/Umbraco.Web.BackOffice/Controllers/TwoFactorLoginController.cs index 627f1ec5c7..9f8aab1873 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/TwoFactorLoginController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/TwoFactorLoginController.cs @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers { private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; private readonly ILogger _logger; - private readonly ITwoFactorLoginService2 _twoFactorLoginService; + private readonly ITwoFactorLoginService _twoFactorLoginService; private readonly IBackOfficeSignInManager _backOfficeSignInManager; private readonly IBackOfficeUserManager _backOfficeUserManager; private readonly IOptionsSnapshot _twoFactorLoginViewOptions; @@ -34,12 +34,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers { _backOfficeSecurityAccessor = backOfficeSecurityAccessor; _logger = logger; - - if (twoFactorLoginService is not ITwoFactorLoginService2 twoFactorLoginService2) - { - throw new ArgumentException("twoFactorLoginService needs to implement ITwoFactorLoginService2 until the interfaces are merged", nameof(twoFactorLoginService)); - } - _twoFactorLoginService = twoFactorLoginService2; + _twoFactorLoginService = twoFactorLoginService; _backOfficeSignInManager = backOfficeSignInManager; _backOfficeUserManager = backOfficeUserManager; _twoFactorLoginViewOptions = twoFactorLoginViewOptions; diff --git a/src/Umbraco.Web.BackOffice/Trees/MemberTypeAndGroupTreeControllerBase.cs b/src/Umbraco.Web.BackOffice/Trees/MemberTypeAndGroupTreeControllerBase.cs index 64e8081dec..9e21cc2318 100644 --- a/src/Umbraco.Web.BackOffice/Trees/MemberTypeAndGroupTreeControllerBase.cs +++ b/src/Umbraco.Web.BackOffice/Trees/MemberTypeAndGroupTreeControllerBase.cs @@ -37,21 +37,6 @@ namespace Umbraco.Cms.Web.BackOffice.Trees _memberTypeService = memberTypeService; } - [Obsolete("Use ctor injecting IMemberTypeService")] - protected MemberTypeAndGroupTreeControllerBase( - ILocalizedTextService localizedTextService, - UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, - IMenuItemCollectionFactory menuItemCollectionFactory, - IEventAggregator eventAggregator) - : this( - localizedTextService, - umbracoApiControllerTypeCollection, - menuItemCollectionFactory, - eventAggregator, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - protected override ActionResult GetTreeNodes(string id, FormCollection queryStrings) { var nodes = new TreeNodeCollection(); diff --git a/src/Umbraco.Web.Common/Extensions/FriendlyImageCropperTemplateExtensions.cs b/src/Umbraco.Web.Common/Extensions/FriendlyImageCropperTemplateExtensions.cs index bdacae95ef..e4481f7f28 100644 --- a/src/Umbraco.Web.Common/Extensions/FriendlyImageCropperTemplateExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/FriendlyImageCropperTemplateExtensions.cs @@ -347,12 +347,4 @@ public static class FriendlyImageCropperTemplateExtensions useCropDimensions, cacheBusterValue, furtherOptions); - - [Obsolete( - "Use GetCropUrl to merge local and media crops, get automatic cache buster value and have more parameters.")] - public static string GetLocalCropUrl( - this MediaWithCrops mediaWithCrops, - string alias, - string? cacheBusterValue = null) => mediaWithCrops.LocalCrops.Src + - mediaWithCrops.LocalCrops.GetCropUrl(alias, ImageUrlGenerator, cacheBusterValue: cacheBusterValue); } diff --git a/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs b/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs index cf73ba481c..74339bac43 100644 --- a/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs +++ b/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs @@ -52,41 +52,6 @@ public class UmbracoRequestMiddleware : IMiddleware private readonly IVariationContextAccessor _variationContextAccessor; private SmidgeOptions _smidgeOptions; - /// - /// Initializes a new instance of the class. - /// - // Obsolete, scheduled for removal in V11 - [Obsolete("Use constructor that takes an IOptions")] - public UmbracoRequestMiddleware( - ILogger logger, - IUmbracoContextFactory umbracoContextFactory, - IRequestCache requestCache, - IEventAggregator eventAggregator, - IProfiler profiler, - IHostingEnvironment hostingEnvironment, - UmbracoRequestPaths umbracoRequestPaths, - BackOfficeWebAssets backOfficeWebAssets, - IOptionsMonitor smidgeOptions, - IRuntimeState runtimeState, - IVariationContextAccessor variationContextAccessor, - IDefaultCultureAccessor defaultCultureAccessor) - : this( - logger, - umbracoContextFactory, - requestCache, - eventAggregator, - profiler, - hostingEnvironment, - umbracoRequestPaths, - backOfficeWebAssets, - smidgeOptions, - runtimeState, - variationContextAccessor, - defaultCultureAccessor, - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Web.Common/RuntimeMinification/SmidgeRuntimeMinifier.cs b/src/Umbraco.Web.Common/RuntimeMinification/SmidgeRuntimeMinifier.cs index 362910e7e4..b06f8d0688 100644 --- a/src/Umbraco.Web.Common/RuntimeMinification/SmidgeRuntimeMinifier.cs +++ b/src/Umbraco.Web.Common/RuntimeMinification/SmidgeRuntimeMinifier.cs @@ -157,14 +157,6 @@ public class SmidgeRuntimeMinifier : IRuntimeMinifier } } - /// - [Obsolete("Invalidation is handled automatically. Scheduled for removal V11.")] - public void Reset() - { - var version = DateTime.UtcNow.Ticks.ToString(); - _configManipulator.SaveConfigValue(Core.Constants.Configuration.ConfigRuntimeMinificationVersion, version); - } - private BundleEnvironmentOptions ConfigureBundleEnvironmentOptions(BundlingOptions bundleOptions) { var bundleEnvironmentOptions = new BundleEnvironmentOptions(); diff --git a/src/Umbraco.Web.Common/Security/ConfigureIISServerOptions.cs b/src/Umbraco.Web.Common/Security/ConfigureIISServerOptions.cs deleted file mode 100644 index fe29d86f51..0000000000 --- a/src/Umbraco.Web.Common/Security/ConfigureIISServerOptions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.Options; -using Umbraco.Cms.Core.Configuration.Models; - -namespace Umbraco.Cms.Web.Common.Security; - -[Obsolete( - "This class is obsolete, as this does not configure your Maximum request length, see https://our.umbraco.com/documentation/Reference/V9-Config/MaximumUploadSizeSettings/ for information about configuring maximum request length")] -public class ConfigureIISServerOptions : IConfigureOptions -{ - private readonly IOptions _runtimeSettings; - - public ConfigureIISServerOptions(IOptions runtimeSettings) => - _runtimeSettings = runtimeSettings; - - public void Configure(IISServerOptions options) => - - // convert from KB to bytes - options.MaxRequestBodySize = _runtimeSettings.Value.MaxRequestLength.HasValue - ? _runtimeSettings.Value.MaxRequestLength.Value * 1024 - : uint.MaxValue; // ~4GB is the max supported value for IIS and IIS express. -} diff --git a/src/Umbraco.Web.Website/Controllers/UmbLoginController.cs b/src/Umbraco.Web.Website/Controllers/UmbLoginController.cs index cd9bc15e35..046849612a 100644 --- a/src/Umbraco.Web.Website/Controllers/UmbLoginController.cs +++ b/src/Umbraco.Web.Website/Controllers/UmbLoginController.cs @@ -41,28 +41,6 @@ public class UmbLoginController : SurfaceController _twoFactorLoginService = twoFactorLoginService; } - [Obsolete("Use ctor with all params")] - public UmbLoginController( - IUmbracoContextAccessor umbracoContextAccessor, - IUmbracoDatabaseFactory databaseFactory, - ServiceContext services, - AppCaches appCaches, - IProfilingLogger profilingLogger, - IPublishedUrlProvider publishedUrlProvider, - IMemberSignInManager signInManager) - : this( - umbracoContextAccessor, - databaseFactory, - services, - appCaches, - profilingLogger, - publishedUrlProvider, - signInManager, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - [HttpPost] [ValidateAntiForgeryToken] [ValidateUmbracoFormRouteString] diff --git a/tests/Umbraco.Tests.Common/Testing/TestOptionAttributeBase.cs b/tests/Umbraco.Tests.Common/Testing/TestOptionAttributeBase.cs index a5a4c2ff41..f8d5d8e3af 100644 --- a/tests/Umbraco.Tests.Common/Testing/TestOptionAttributeBase.cs +++ b/tests/Umbraco.Tests.Common/Testing/TestOptionAttributeBase.cs @@ -13,9 +13,6 @@ namespace Umbraco.Cms.Tests.Common.Testing { public abstract class TestOptionAttributeBase : Attribute { - [Obsolete("This is not used anymore - Test classes are found using nunit helpers")] - public static readonly List ScanAssemblies = new List(); - public static TOptions GetTestOptions(MethodInfo method) where TOptions : TestOptionAttributeBase, new() { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs index d0d90c5726..ae6deb35bc 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs @@ -86,7 +86,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core private class TestMigration : PackageMigrationBase { - public TestMigration(IPackagingService packagingService, IMediaService mediaService, MediaFileManager mediaFileManager, MediaUrlGeneratorCollection mediaUrlGenerators, IShortStringHelper shortStringHelper, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IMigrationContext context) : base(packagingService, mediaService, mediaFileManager, mediaUrlGenerators, shortStringHelper, contentTypeBaseServiceProvider, context) + public TestMigration(IPackagingService packagingService, IMediaService mediaService, MediaFileManager mediaFileManager, MediaUrlGeneratorCollection mediaUrlGenerators, IShortStringHelper shortStringHelper, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IMigrationContext context, IOptions options) : base(packagingService, mediaService, mediaFileManager, mediaUrlGenerators, shortStringHelper, contentTypeBaseServiceProvider, context, options) { } diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs index cc446e0ea6..e7ddd13e0b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs @@ -776,7 +776,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging // Act var contentTypes = PackageDataInstallation .ImportDocumentType(withoutCleanupPolicy, 0) - .OfType(); + .OfType(); // Assert Assert.Multiple(() => @@ -795,7 +795,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging // Act var contentTypes = PackageDataInstallation .ImportDocumentType(docTypeElement, 0) - .OfType(); + .OfType(); // Assert Assert.Multiple(() => @@ -817,11 +817,11 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging // Act var contentTypes = PackageDataInstallation .ImportDocumentType(withCleanupPolicy, 0) - .OfType(); + .OfType(); var contentTypesUpdated = PackageDataInstallation .ImportDocumentType(withoutCleanupPolicy, 0) - .OfType(); + .OfType(); // Assert Assert.Multiple(() => diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MacroServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MacroServiceTests.cs index bd233e5243..d668cab085 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MacroServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MacroServiceTests.cs @@ -27,8 +27,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] public class MacroServiceTests : UmbracoIntegrationTest { - [Obsolete("After merging IMacroWithAliasService interface with IMacroService in Umbraco 11, this should go back to just being GetRequiredService()")] - private IMacroWithAliasService MacroService => GetRequiredService() as IMacroWithAliasService; + private IMacroService MacroService => GetRequiredService(); [SetUp] public void SetupTest() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs index 0156100f0a..621f11b3d0 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs @@ -120,7 +120,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services public void Can_Create_RelationType_Without_Name() { IRelationService rs = RelationService; - IRelationType rt = new RelationType("Test", "repeatedEventOccurence", false, Constants.ObjectTypes.Document, Constants.ObjectTypes.Media); + IRelationType rt = new RelationType("Test", "repeatedEventOccurence", false, Constants.ObjectTypes.Document, Constants.ObjectTypes.Media, false); Assert.DoesNotThrow(() => rs.Save(rt)); @@ -138,7 +138,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services public void Create_Relation_Type_Without_Object_Types() { IRelationService rs = RelationService; - IRelationType rt = new RelationType("repeatedEventOccurence", "repeatedEventOccurence", false, null, null); + IRelationType rt = new RelationType("repeatedEventOccurence", "repeatedEventOccurence", false, null, null, false); Assert.DoesNotThrow(() => rs.Save(rt)); @@ -215,7 +215,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services private IRelation CreateAndSaveRelation(string name, string alias) { IRelationService rs = RelationService; - var rt = new RelationType(name, alias, false, null, null); + var rt = new RelationType(name, alias, false, null, null, false); rs.Save(rt); ContentType ct = ContentTypeBuilder.CreateBasicContentType(); @@ -244,7 +244,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services { IRelationService rs = RelationService; string rtName = Guid.NewGuid().ToString(); - var rt = new RelationType(rtName, rtName, false, null, null); + var rt = new RelationType(rtName, rtName, false, null, null, false); rs.Save(rt); ContentType ct = ContentTypeBuilder.CreateBasicContentType(); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumExtensionsTests.cs index ebb563bdf4..c2d4db3647 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumExtensionsTests.cs @@ -29,25 +29,6 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core } } - [Obsolete] - [TestCase(TreeUse.Dialog, TreeUse.Dialog, true)] - [TestCase(TreeUse.Dialog, TreeUse.Main, false)] - [TestCase(TreeUse.Dialog | TreeUse.Main, TreeUse.Dialog, true)] - [TestCase(TreeUse.Dialog, TreeUse.Dialog | TreeUse.Main, false)] - public void HasFlagAllTest(TreeUse value, TreeUse test, bool expected) - { - // The HasFlagAll() extension method determines whether - // all bits from are set (other bits can be set too). - if (expected) - { - Assert.IsTrue(value.HasFlagAll(test)); - } - else - { - Assert.IsFalse(value.HasFlagAll(test)); - } - } - [TestCase(TreeUse.Dialog, TreeUse.Dialog, true)] [TestCase(TreeUse.Dialog, TreeUse.Main, false)] [TestCase(TreeUse.Dialog | TreeUse.Main, TreeUse.Dialog, true)] diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/DefaultShortStringHelperTestsWithoutSetup.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/DefaultShortStringHelperTestsWithoutSetup.cs index b686aee278..e9972f26c9 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/DefaultShortStringHelperTestsWithoutSetup.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/DefaultShortStringHelperTestsWithoutSetup.cs @@ -20,7 +20,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.ShortStringHelper { var requestHandlerSettings = new RequestHandlerSettings() { - CharCollection = Array.Empty(), + UserDefinedCharCollection = Array.Empty(), EnableDefaultCharReplacements = false, ConvertUrlsToAscii = "false" }; @@ -47,7 +47,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.ShortStringHelper { var requestHandlerSettings = new RequestHandlerSettings() { - CharCollection = Array.Empty(), + UserDefinedCharCollection = Array.Empty(), EnableDefaultCharReplacements = false, ConvertUrlsToAscii = "false" }; @@ -342,7 +342,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.ShortStringHelper { var requestHandlerSettings = new RequestHandlerSettings() { - CharCollection = Array.Empty(), + UserDefinedCharCollection = Array.Empty(), EnableDefaultCharReplacements = false, ConvertUrlsToAscii = "false" };