V11: cleanup obsoletes (#12481)

* Remove IExternalLoginService.cs

* Remove UmbracoApplicationComponentsInstallingNotification.cs

* Remove UmbracoApplicationMainDomAcquiredNotification.cs

* Merge IContentTypeWithHistoryCleanup with IContentType.cs

* Remove obsolete ctors from notifications

* Remove obsolete methods

* Remove obsolete method from RequestHandlerSettings.cs

* Fix UmbracoBuilder.Repositories.cs

* RemoveRemove obsolete constants

* Remove obsolete method from IRuntimeMinifier

* Remove SetLastLogin from IMemberRepository

* Revert "RemoveRemove obsolete constants"

This reverts commit cddb8ad1cf3d02bd9949d52bed91b45c8d2d66a9.

* Remove obsoleted Constants-Conventions.cs

* Remove obsolete ctors

* Make ContentData properties immutable

* remove obsolete static property from TestOptionAttributeBase

* Merge IMacroWithAliasService into IMacroService

* Remove IUserComposer

* remove obsolete AddOEmbedProvider method

* remove obsolete static EmbedProvidersCollectionBuilder

* remove obsolete HasFlagAll<T> method

* Remove obsolete LocalizedTextService property from BaseHttpHeaderCheck

* Remove obsolete GetDefaultFIleContent method from ViewHelper

* Remove more obsolete ctors and methods

* Remove obsolete ctor from RelationType

* Remove more obsolete methods

* Remove IExternalLoginRepository

* merge IMacroWithAliasRepository with IMacroRepository

* Remove obsolete methods from ExternalLoginRepository

* Remove obsolete method from IUserRepository

* Remove obsolete SetLastLogin, as it was NoOp

* Remove wierd SetLastLogin method from UserService

* Remove GetLogLevel from ILogViewer

* Remove more obsolete methods and ctors

* Remove more obsoletes

* Use other method in BackOfficeServerVariables.cs since GetAllTypes is now removed

* Remove obsolete ctor

* Remove ConfigureIISServerOptions

* Remove more obsolete methods

* Merge ITwoFactorLoginService2 with ITwoFactorLoginService

* Re-introduce GetCustomGenericProperties in MemberTabsAndPropertiesMapper.cs

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
This commit is contained in:
Nikolaj Geisle
2022-06-07 11:16:30 +02:00
committed by GitHub
parent 882de44e38
commit b4fbad14c7
93 changed files with 81 additions and 1076 deletions

View File

@@ -1,9 +0,0 @@
namespace Umbraco.Cms.Core.Composing
{
/// <summary>
/// Represents a user <see cref="IComposer"/>.
/// </summary>
[System.Obsolete("This interface is obsolete. Use IComposer instead.")]
public interface IUserComposer : IComposer
{ }
}

View File

@@ -76,12 +76,6 @@ namespace Umbraco.Cms.Core.Configuration.Models
[DefaultValue(StaticEnableDefaultCharReplacements)]
public bool EnableDefaultCharReplacements { get; set; } = StaticEnableDefaultCharReplacements;
/// <summary>
/// Add additional character replacements, or override defaults
/// </summary>
[Obsolete("Use the GetCharReplacements extension method in the Umbraco.Extensions namespace instead. Scheduled for removal in V11")]
public IEnumerable<IChar> CharCollection { get; set; } = DefaultCharCollection;
/// <summary>
/// Add additional character replacements, or override defaults
/// </summary>

View File

@@ -186,54 +186,6 @@ namespace Umbraco.Cms.Core
public const string CommentsLabel = "Comments";
/// <summary>
/// Property alias for the Approved boolean of a Member
/// </summary>
[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";
/// <summary>
/// Property alias for the Locked out boolean of a Member
/// </summary>
[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";
/// <summary>
/// Property alias for the last date the Member logged in
/// </summary>
[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";
/// <summary>
/// Property alias for the last date a Member changed its password
/// </summary>
[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";
/// <summary>
/// Property alias for the last date a Member was locked out
/// </summary>
[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";
/// <summary>
/// Property alias for the number of failed login attempts
/// </summary>
[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";
/// <summary>
/// The standard properties group alias for membership properties.
/// </summary>

View File

@@ -54,15 +54,6 @@ namespace Umbraco.Extensions
services.AddUnique<TService2>(factory => (TImplementing)factory.GetRequiredService<TService1>(), lifetime);
}
// TODO(V11): Remove this function.
[Obsolete("This method is functionally equivalent to AddSingleton<TImplementing>() please use that instead.")]
public static void AddUnique<TImplementing>(this IServiceCollection services)
where TImplementing : class
{
services.RemoveAll<TImplementing>();
services.AddSingleton<TImplementing>();
}
/// <summary>
/// Adds a service of type <typeparamref name="TService"/> with an implementation factory method to the specified <see cref="IServiceCollection"/>.
/// </summary>

View File

@@ -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<T>(this IUmbracoBuilder builder)
where T : class, IEmbedProvider => AddEmbedProvider<T>(builder);
/// <summary>
/// Register a section.
/// </summary>

View File

@@ -263,14 +263,6 @@ namespace Umbraco.Cms.Core.DependencyInjection
public static MediaUrlGeneratorCollectionBuilder MediaUrlGenerators(this IUmbracoBuilder builder)
=> builder.WithCollectionBuilder<MediaUrlGeneratorCollectionBuilder>();
/// <summary>
/// Gets the backoffice OEmbed Providers collection builder.
/// </summary>
/// <param name="builder">The builder.</param>
[Obsolete("Use EmbedProviders() instead")]
public static EmbedProvidersCollectionBuilder OEmbedProviders(this IUmbracoBuilder builder)
=> EmbedProviders(builder);
/// <summary>
/// Gets the backoffice Embed Providers collection builder.
/// </summary>

View File

@@ -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<RequestHandlerSettings>(options => options.MergeReplacements(builder.Config));
return builder;
}
}

View File

@@ -309,7 +309,6 @@ namespace Umbraco.Cms.Core.DependencyInjection
factory.GetRequiredService<IEventMessagesFactory>(),
factory.GetRequiredService<IExternalLoginWithKeyRepository>()
));
Services.AddUnique<IExternalLoginService>(factory => factory.GetRequiredService<ExternalLoginService>());
Services.AddUnique<IExternalLoginWithKeyService>(factory => factory.GetRequiredService<ExternalLoginService>());
Services.AddUnique<ILocalizedTextService>(factory => new LocalizedTextService(
factory.GetRequiredService<Lazy<LocalizedTextServiceFileSources>>(),

View File

@@ -10,22 +10,6 @@ namespace Umbraco.Extensions
/// </summary>
public static class EnumExtensions
{
/// <summary>
/// Determines whether all the flags/bits are set within the enum value.
/// </summary>
/// <typeparam name="T">The enum type.</typeparam>
/// <param name="value">The enum value.</param>
/// <param name="flags">The flags.</param>
/// <returns>
/// <c>true</c> if all the flags/bits are set within the enum value; otherwise, <c>false</c>.
/// </returns>
[Obsolete("Use Enum.HasFlag() or bitwise operations (if performance is important) instead.")]
public static bool HasFlagAll<T>(this T value, T flags)
where T : Enum
{
return value.HasFlag(flags);
}
/// <summary>
/// Determines whether any of the flags/bits are set within the enum value.
/// </summary>

View File

@@ -32,26 +32,6 @@ namespace Umbraco.Extensions
return MergeUnique(requestHandlerSettings.UserDefinedCharCollection, RequestHandlerSettings.DefaultCharCollection);
}
/// <summary>
/// Merges CharCollection and UserDefinedCharCollection, prioritizing UserDefinedCharCollection
/// </summary>
internal static void MergeReplacements(this RequestHandlerSettings requestHandlerSettings, IConfiguration configuration)
{
string sectionKey = $"{Constants.Configuration.ConfigRequestHandler}:";
IEnumerable<CharItem> charCollection = GetReplacements(
configuration,
$"{sectionKey}{nameof(RequestHandlerSettings.CharCollection)}");
IEnumerable<CharItem> userDefinedCharCollection = GetReplacements(
configuration,
$"{sectionKey}{nameof(requestHandlerSettings.UserDefinedCharCollection)}");
IEnumerable<CharItem> mergedCollection = MergeUnique(userDefinedCharCollection, charCollection);
requestHandlerSettings.UserDefinedCharCollection = mergedCollection;
}
private static IEnumerable<CharItem> GetReplacements(IConfiguration configuration, string key)
{
var replacements = new List<CharItem>();

View File

@@ -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;
/// <summary>
/// Initializes a new instance of the <see cref="BaseHttpHeaderCheck"/> class.
/// </summary>

View File

@@ -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<IDefaultViewContentProvider>();
}
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<IDefaultViewContentProvider>();
return viewContentProvider.GetDefaultFileContent(layoutPageAlias, modelClassName, modelNamespace,
modelNamespaceAlias);
}
private string SaveTemplateToFile(ITemplate template)
{
var design = template.Content.IsNullOrWhiteSpace() ? EnsureInheritedLayout(template) : template.Content!;

View File

@@ -27,15 +27,6 @@ namespace Umbraco.Cms.Core.Install.InstallSteps
_siteIdentifierService = siteIdentifierService;
}
[Obsolete("Use constructor that takes GlobalSettings and ISiteIdentifierService")]
public TelemetryIdentifierStep(
ILogger<TelemetryIdentifierStep> logger,
IOptions<GlobalSettings> globalSettings,
IConfigManipulator configManipulator)
: this(globalSettings, StaticServiceProvider.Instance.GetRequiredService<ISiteIdentifierService>())
{
}
public override Task<InstallSetupResult?> ExecuteAsync(object model)
{
_siteIdentifierService.TryCreateSiteIdentifier(out _);

View File

@@ -29,14 +29,5 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
/// </summary>
[DataMember(Name = "permissions")]
public IDictionary<int, IEnumerable<string>> AssignedPermissions { get; set; }
[Obsolete("This is not used and will be removed in Umbraco 10")]
public IEnumerable<ValidationResult> 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" });
}
}
}
}

View File

@@ -13,7 +13,7 @@ namespace Umbraco.Cms.Core.Models
/// </summary>
[Serializable]
[DataContract(IsReference = true)]
public class ContentType : ContentTypeCompositionBase, IContentTypeWithHistoryCleanup
public class ContentType : ContentTypeCompositionBase, IContentType
{
public const bool SupportsPublishingConst = true;

View File

@@ -4,19 +4,6 @@ using Umbraco.Cms.Core.Models.ContentEditing;
namespace Umbraco.Cms.Core.Models
{
/// <summary>
/// Defines a content type that contains a history cleanup policy.
/// </summary>
[Obsolete("This will be merged into IContentType in Umbraco 10.")]
public interface IContentTypeWithHistoryCleanup : IContentType
{
/// <summary>
/// Gets or sets the history cleanup configuration.
/// </summary>
/// <value>The history cleanup configuration.</value>
HistoryCleanup? HistoryCleanup { get; set; }
}
/// <summary>
/// Defines a ContentType, which Content is based on
/// </summary>
@@ -70,5 +57,11 @@ namespace Umbraco.Cms.Core.Models
/// <param name="newAlias"></param>
/// <returns></returns>
IContentType DeepCloneWithResetIdentities(string newAlias);
/// <summary>
/// Gets or sets the history cleanup configuration.
/// </summary>
/// <value>The history cleanup configuration.</value>
HistoryCleanup? HistoryCleanup { get; set; }
}
}

View File

@@ -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;
}
/// <inheritdoc />
[DataMember]
public string IsoCode

View File

@@ -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> globalSettings,
IHostingEnvironment hostingEnvironment)
: this(commonMapper, propertyEditors, dataTypeService, fileService, contentTypeService, mediaTypeService,
memberTypeService, loggerFactory, shortStringHelper, globalSettings, hostingEnvironment,
StaticServiceProvider.Instance.GetRequiredService<IOptionsMonitor<ContentSettings>>())
{
}
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<DocumentTypeSave, PropertyTypeBasic>(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<DocumentTypeDisplay, PropertyTypeDisplay>(source, target);
if (source is IContentTypeWithHistoryCleanup sourceWithHistoryCleanup)
if (source is IContentType sourceWithHistoryCleanup)
{
target.HistoryCleanup = new HistoryCleanupViewModel
{

View File

@@ -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;

View File

@@ -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<ContentPropertyDisplay> GetCustomGenericProperties(IContentBase content)
{
var member = (IMember)content;

View File

@@ -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<string> compositionAliases, IEnumerable<PublishedPropertyType> 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();
}
/// <summary>
/// This constructor is for tests and is not intended to be used directly from application code.
/// </summary>
@@ -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<string> compositionAliases, Func<IPublishedContentType, IEnumerable<IPublishedPropertyType>> 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<string> compositionAliases, ContentVariation variations, bool isElement)
{
Key = key;

View File

@@ -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));

View File

@@ -1,29 +0,0 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
namespace Umbraco.Cms.Core.Notifications
{
// TODO (V10): Remove this class.
/// <summary>
/// Notification that occurs during the Umbraco boot process, before instances of <see cref="IComponent"/> initialize.
/// </summary>
[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
{
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoApplicationComponentsInstallingNotification"/> class.
/// </summary>
/// <param name="runtimeLevel">The runtime level</param>
public UmbracoApplicationComponentsInstallingNotification(RuntimeLevel runtimeLevel) => RuntimeLevel = runtimeLevel;
/// <summary>
/// Gets the runtime level of execution.
/// </summary>
public RuntimeLevel RuntimeLevel { get; }
}
}

View File

@@ -1,26 +0,0 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
namespace Umbraco.Cms.Core.Notifications
{
// TODO (V10): Remove this class.
/// <summary>
/// Notification that occurs during Umbraco boot after the MainDom has been acquired.
/// </summary>
[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
{
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoApplicationMainDomAcquiredNotification"/> class.
/// </summary>
/// <param name="runtimeLevel">The runtime level</param>
public UmbracoApplicationMainDomAcquiredNotification()
{
}
}
}

View File

@@ -8,17 +8,6 @@ namespace Umbraco.Cms.Core.Notifications
/// <seealso cref="Umbraco.Cms.Core.Notifications.IUmbracoApplicationLifetimeNotification" />
public class UmbracoApplicationStartingNotification : IUmbracoApplicationLifetimeNotification
{
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoApplicationStartingNotification" /> class.
/// </summary>
/// <param name="runtimeLevel">The runtime level</param>
[Obsolete("Use ctor with all params")]
public UmbracoApplicationStartingNotification(RuntimeLevel runtimeLevel)
: this(runtimeLevel, false)
{
// TODO: Remove this constructor in V10
}
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoApplicationStartingNotification" /> class.
/// </summary>

View File

@@ -8,16 +8,6 @@ namespace Umbraco.Cms.Core.Notifications
/// <seealso cref="Umbraco.Cms.Core.Notifications.IUmbracoApplicationLifetimeNotification" />
public class UmbracoApplicationStoppingNotification : IUmbracoApplicationLifetimeNotification
{
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoApplicationStoppingNotification" /> class.
/// </summary>
[Obsolete("Use ctor with all params")]
public UmbracoApplicationStoppingNotification()
: this(false)
{
// TODO: Remove this constructor in V10
}
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoApplicationStoppingNotification" /> class.
/// </summary>

View File

@@ -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<int, IIdentityUserLogin>, IQueryRepository<IIdentityUserToken>
{
/// <summary>
/// Replaces all external login providers for the user
/// </summary>
/// <param name="userId"></param>
/// <param name="logins"></param>
[Obsolete("Use method that takes guid as param from IExternalLoginWithKeyRepository")]
void Save(int userId, IEnumerable<IExternalLogin> logins);
/// <summary>
/// Replaces all external login provider tokens for the providers specified for the user
/// </summary>
/// <param name="userId"></param>
/// <param name="tokens"></param>
[Obsolete("Use method that takes guid as param from IExternalLoginWithKeyRepository")]
void Save(int userId, IEnumerable<IExternalLoginToken> tokens);
[Obsolete("Use method that takes guid as param from IExternalLoginWithKeyRepository")]
void DeleteUserLogins(int memberId);
}
}

View File

@@ -5,8 +5,8 @@ namespace Umbraco.Cms.Core.Persistence.Repositories
{
public interface IMacroRepository : IReadWriteQueryRepository<int, IMacro>, IReadRepository<Guid, IMacro>
{
IMacro? GetByAlias(string alias);
//IEnumerable<IMacro> GetAll(params string[] aliases);
IEnumerable<IMacro> GetAllByAlias(string[] aliases);
}
}

View File

@@ -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<IMacro> GetAllByAlias(string[] aliases);
}
}

View File

@@ -40,18 +40,5 @@ namespace Umbraco.Cms.Core.Persistence.Repositories
/// <param name="query"></param>
/// <returns></returns>
int GetCountByQuery(IQuery<IMember>? query);
/// <summary>
/// Sets a members last login date based on their username
/// </summary>
/// <param name="username"></param>
/// <param name="date"></param>
/// <remarks>
/// 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.
/// </remarks>
[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);
}
}

View File

@@ -15,14 +15,6 @@ namespace Umbraco.Cms.Core.Persistence.Repositories
/// <returns></returns>
int GetCountByQuery(IQuery<IUser>? query);
/// <summary>
/// Checks if a user with the username exists
/// </summary>
/// <param name="username"></param>
/// <returns></returns>
[Obsolete("This method will be removed in future versions. Please use ExistsByUserName instead.")]
bool Exists(string username);
/// <summary>
/// Checks if a user with the username exists
/// </summary>

View File

@@ -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));
}
/// <inheritdoc />
public virtual Type GetPropertyValueType(IPublishedPropertyType propertyType)
=> typeof(object);

View File

@@ -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<RequestHandlerSettings> requestSettings, ILogger<DefaultUrlProvider> logger,
ISiteDomainMapper siteDomainMapper, IUmbracoContextAccessor umbracoContextAccessor, UriUtility uriUtility)
: this(requestSettings, logger, siteDomainMapper, umbracoContextAccessor, uriUtility,
StaticServiceProvider.Instance.GetRequiredService<ILocalizationService>())
{
}
public DefaultUrlProvider(
IOptionsMonitor<RequestHandlerSettings> requestSettings,
ILogger<DefaultUrlProvider> logger,

View File

@@ -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));
}

View File

@@ -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<IExternalLoginWithKeyRepository>())
{
}
/// <inheritdoc />
[Obsolete("Use overload that takes a user/member key (Guid).")]
public IEnumerable<IIdentityUserLogin> GetExternalLogins(int userId)
=> GetExternalLogins(userId.ToGuid());
/// <inheritdoc />
[Obsolete("Use overload that takes a user/member key (Guid).")]
public IEnumerable<IIdentityUserToken> GetExternalLoginTokens(int userId) =>
GetExternalLoginTokens(userId.ToGuid());
/// <inheritdoc />
[Obsolete("Use overload that takes a user/member key (Guid).")]
public void Save(int userId, IEnumerable<IExternalLogin> logins)
=> Save(userId.ToGuid(), logins);
/// <inheritdoc />
[Obsolete("Use overload that takes a user/member key (Guid).")]
public void Save(int userId, IEnumerable<IExternalLoginToken> tokens)
=> Save(userId.ToGuid(), tokens);
/// <inheritdoc />
[Obsolete("Use overload that takes a user/member key (Guid).")]
public void DeleteUserLogins(int userId)
=> DeleteUserLogins(userId.ToGuid());
/// <inheritdoc />
public IEnumerable<IIdentityUserLogin> GetExternalLogins(Guid userOrMemberKey)
{

View File

@@ -1,66 +0,0 @@
using System;
using System.Collections.Generic;
using Umbraco.Cms.Core.Security;
namespace Umbraco.Cms.Core.Services
{
/// <summary>
/// Used to store the external login info
/// </summary>
[Obsolete("Use IExternalLoginServiceWithKey. This will be removed in Umbraco 10")]
public interface IExternalLoginService : IService
{
/// <summary>
/// Returns all user logins assigned
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
IEnumerable<IIdentityUserLogin> GetExternalLogins(int userId);
/// <summary>
/// Returns all user login tokens assigned
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
IEnumerable<IIdentityUserToken> GetExternalLoginTokens(int userId);
/// <summary>
/// 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
/// </summary>
/// <param name="loginProvider"></param>
/// <param name="providerKey"></param>
/// <returns></returns>
IEnumerable<IIdentityUserLogin> Find(string loginProvider, string providerKey);
/// <summary>
/// Saves the external logins associated with the user
/// </summary>
/// <param name="userId">
/// The user associated with the logins
/// </param>
/// <param name="logins"></param>
/// <remarks>
/// This will replace all external login provider information for the user
/// </remarks>
void Save(int userId, IEnumerable<IExternalLogin> logins);
/// <summary>
/// Saves the external login tokens associated with the user
/// </summary>
/// <param name="userId">
/// The user associated with the tokens
/// </param>
/// <param name="tokens"></param>
/// <remarks>
/// This will replace all external login tokens for the user
/// </remarks>
void Save(int userId, IEnumerable<IExternalLoginToken> tokens);
/// <summary>
/// Deletes all user logins - normally used when a member is deleted
/// </summary>
/// <param name="userId"></param>
void DeleteUserLogins(int userId);
}
}

View File

@@ -53,5 +53,12 @@ namespace Umbraco.Cms.Core.Services
///// <param name="alias">Alias to retrieve an <see cref="IMacroPropertyType"/> for</param>
///// <returns>An <see cref="IMacroPropertyType"/> object</returns>
//IMacroPropertyType GetMacroPropertyTypeByAlias(string alias);
/// <summary>
/// Gets a list of available <see cref="IMacro"/> objects by alias.
/// </summary>
/// <param name="aliases">Optional array of aliases to limit the results</param>
/// <returns>An enumerable list of <see cref="IMacro"/> objects</returns>
IEnumerable<IMacro> GetAll(params string[] aliases);
}
}

View File

@@ -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
{
/// <summary>
/// Gets a list of available <see cref="IMacro"/> objects by alias.
/// </summary>
/// <param name="aliases">Optional array of aliases to limit the results</param>
/// <returns>An enumerable list of <see cref="IMacro"/> objects</returns>
IEnumerable<IMacro> GetAll(params string[] aliases);
}
}

View File

@@ -108,18 +108,6 @@ namespace Umbraco.Cms.Core.Services
/// <param name="membershipUser"><see cref="IMember"/> or <see cref="IUser"/> to Delete</param>
void Delete(T membershipUser);
/// <summary>
/// Sets the last login date for the member if they are found by username
/// </summary>
/// <param name="username"></param>
/// <param name="date"></param>
/// <remarks>
/// 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.
/// </remarks>
void SetLastLogin(string username, DateTime date);
/// <summary>
/// Saves an <see cref="IMembershipUser"/>
/// </summary>

View File

@@ -57,13 +57,15 @@ namespace Umbraco.Cms.Core.Services
/// Gets all the enabled 2FA providers for the user or member with the specified key.
/// </summary>
Task<IEnumerable<string>> GetEnabledTwoFactorProviderNamesAsync(Guid userOrMemberKey);
}
[Obsolete("This will be merged into ITwoFactorLoginService in Umbraco 11")]
public interface ITwoFactorLoginService2 : ITwoFactorLoginService
{
/// <summary>
/// Disables 2FA with Code.
/// </summary>
Task<bool> DisableWithCodeAsync(string providerName, Guid userOrMemberKey, string code);
/// <summary>
/// Validates and Saves.
/// </summary>
Task<bool> ValidateAndSaveAsync(string providerName, Guid userKey, string secret, string code);
}
}

View File

@@ -109,12 +109,6 @@ namespace Umbraco.Cms.Core.Services
XmlSourceToNoAreaDictionary(source));
}
[Obsolete("Use other ctor with IDictionary<CultureInfo, Lazy<IDictionary<string, IDictionary<string, string>>>> as input parameter.")]
public LocalizedTextService(IDictionary<CultureInfo, IDictionary<string, IDictionary<string, string>>> source,
ILogger<LocalizedTextService> logger) : this(source.ToDictionary(x=>x.Key, x=> new Lazy<IDictionary<string, IDictionary<string, string>>>(() => x.Value)), logger)
{
}
/// <summary>
/// Initializes with a source of a dictionary of culture -> areas -> sub dictionary of keys/values
/// </summary>

View File

@@ -13,7 +13,7 @@ namespace Umbraco.Cms.Core.Services
/// <summary>
/// Represents the Macro Service, which is an easy access to operations involving <see cref="IMacro"/>
/// </summary>
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
/// <returns>An <see cref="IMacro"/> object</returns>
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<IMacro> GetAll(params string[] aliases)
{
if (_macroRepository is not IMacroWithAliasRepository macroWithAliasRepository)
if (_macroRepository is not IMacroRepository macroWithAliasRepository)
{
var hashset = new HashSet<string>(aliases);
return GetAll().Where(x => hashset.Contains(x.Alias));

View File

@@ -747,12 +747,6 @@ namespace Umbraco.Cms.Core.Services
#region Save
/// <inheritdoc />
[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)
{
}
/// <inheritdoc />
public void Save(IMember member)
{

View File

@@ -29,7 +29,7 @@ namespace Umbraco.Cms.Core.Services
private readonly Lazy<IMemberTypeService>? _memberTypeService;
private readonly Lazy<IMemberGroupService>? _memberGroupService;
private readonly Lazy<INotificationService>? _notificationService;
private readonly Lazy<IExternalLoginService>? _externalLoginService;
private readonly Lazy<IExternalLoginWithKeyService>? _externalLoginService;
private readonly Lazy<IRedirectUrlService>? _redirectUrlService;
private readonly Lazy<IConsentService>? _consentService;
private readonly Lazy<IKeyValueService>? _keyValueService;
@@ -38,7 +38,7 @@ namespace Umbraco.Cms.Core.Services
/// <summary>
/// Initializes a new instance of the <see cref="ServiceContext"/> class with lazy services.
/// </summary>
public ServiceContext(Lazy<IPublicAccessService>? publicAccessService, Lazy<IDomainService>? domainService, Lazy<IAuditService>? auditService, Lazy<ILocalizedTextService>? localizedTextService, Lazy<ITagService>? tagService, Lazy<IContentService>? contentService, Lazy<IUserService>? userService, Lazy<IMemberService>? memberService, Lazy<IMediaService>? mediaService, Lazy<IContentTypeService>? contentTypeService, Lazy<IMediaTypeService>? mediaTypeService, Lazy<IDataTypeService>? dataTypeService, Lazy<IFileService>? fileService, Lazy<ILocalizationService>? localizationService, Lazy<IPackagingService>? packagingService, Lazy<IServerRegistrationService>? serverRegistrationService, Lazy<IEntityService>? entityService, Lazy<IRelationService>? relationService, Lazy<IMacroService>? macroService, Lazy<IMemberTypeService>? memberTypeService, Lazy<IMemberGroupService>? memberGroupService, Lazy<INotificationService>? notificationService, Lazy<IExternalLoginService>? externalLoginService, Lazy<IRedirectUrlService>? redirectUrlService, Lazy<IConsentService>? consentService, Lazy<IKeyValueService>? keyValueService, Lazy<IContentTypeBaseServiceProvider>? contentTypeBaseServiceProvider)
public ServiceContext(Lazy<IPublicAccessService>? publicAccessService, Lazy<IDomainService>? domainService, Lazy<IAuditService>? auditService, Lazy<ILocalizedTextService>? localizedTextService, Lazy<ITagService>? tagService, Lazy<IContentService>? contentService, Lazy<IUserService>? userService, Lazy<IMemberService>? memberService, Lazy<IMediaService>? mediaService, Lazy<IContentTypeService>? contentTypeService, Lazy<IMediaTypeService>? mediaTypeService, Lazy<IDataTypeService>? dataTypeService, Lazy<IFileService>? fileService, Lazy<ILocalizationService>? localizationService, Lazy<IPackagingService>? packagingService, Lazy<IServerRegistrationService>? serverRegistrationService, Lazy<IEntityService>? entityService, Lazy<IRelationService>? relationService, Lazy<IMacroService>? macroService, Lazy<IMemberTypeService>? memberTypeService, Lazy<IMemberGroupService>? memberGroupService, Lazy<INotificationService>? notificationService, Lazy<IExternalLoginWithKeyService>? externalLoginService, Lazy<IRedirectUrlService>? redirectUrlService, Lazy<IConsentService>? consentService, Lazy<IKeyValueService>? keyValueService, Lazy<IContentTypeBaseServiceProvider>? 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
/// <summary>
/// Gets the ExternalLoginService.
/// </summary>
public IExternalLoginService? ExternalLoginService => _externalLoginService?.Value;
public IExternalLoginWithKeyService? ExternalLoginService => _externalLoginService?.Value;
/// <summary>
/// Gets the RedirectUrlService.

View File

@@ -15,7 +15,7 @@ using Umbraco.Cms.Web.Common.DependencyInjection;
namespace Umbraco.Cms.Core.Services
{
/// <inheritdoc />
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<ITwoFactorProvider> twoFactorSetupGenerators,
IOptions<IdentityOptions> identityOptions,
IOptions<BackOfficeIdentityOptions> backOfficeIdentityOptions)
: this(twoFactorLoginRepository,
scopeProvider,
twoFactorSetupGenerators,
identityOptions,
backOfficeIdentityOptions,
StaticServiceProvider.Instance.GetRequiredService<ILogger<TwoFactorLoginService>>())
{
}
/// <inheritdoc />
public async Task DeleteUserLoginsAsync(Guid userOrMemberKey)
{

View File

@@ -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<IUser>.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.");
}
/// <summary>
/// Saves an <see cref="IUser"/>
/// </summary>

View File

@@ -84,22 +84,5 @@ namespace Umbraco.Cms.Core.WebAssets
/// <param name="assetType"></param>
/// <returns></returns>
Task<string> MinifyAsync(string? fileContent, AssetType assetType);
/// <summary>
/// Ensures that all runtime minifications are refreshed on next request. E.g. Clearing cache.
/// </summary>
/// <remarks>
/// <para>
/// No longer necessary, invalidation occurs automatically if any of the following occur.
/// </para>
/// <list type="bullet">
/// <item>Your sites assembly information version changes.</item>
/// <item>Umbraco.Cms.Core assembly information version changes.</item>
/// <item>RuntimeMinificationSettings Version string changes.</item>
/// </list>
/// <see href="https://our.umbraco.com/documentation/Reference/V9-Config/RuntimeMinificationSettings/" /> for further details.
/// </remarks>
[Obsolete("Invalidation is handled automatically. Scheduled for removal V11.")]
void Reset();
}
}

View File

@@ -18,11 +18,6 @@ namespace Umbraco.Cms.Core.Configuration
private readonly ILogger<JsonConfigManipulator> _logger;
private readonly object _locker = new object();
[Obsolete]
public JsonConfigManipulator(IConfiguration configuration)
: this(configuration, StaticServiceProvider.Instance.GetRequiredService<ILogger<JsonConfigManipulator>>())
{ }
public JsonConfigManipulator(
IConfiguration configuration,
ILogger<JsonConfigManipulator> logger)

View File

@@ -33,8 +33,7 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
builder.Services.AddUnique<IDomainRepository, DomainRepository>();
builder.Services.AddMultipleUnique<IEntityRepository, IEntityRepositoryExtended, EntityRepository>();
builder.Services.AddUnique<ITwoFactorLoginRepository, TwoFactorLoginRepository>();
builder.Services.AddUnique<ExternalLoginRepository>();
builder.Services.AddUnique<IExternalLoginRepository>(factory => factory.GetRequiredService<ExternalLoginRepository>());
builder.Services.AddSingleton<ExternalLoginRepository>();
builder.Services.AddUnique<IExternalLoginWithKeyRepository>(factory => factory.GetRequiredService<ExternalLoginRepository>());
builder.Services.AddUnique<ILanguageRepository, LanguageRepository>();
builder.Services.AddUnique<IMacroRepository, MacroRepository>();

View File

@@ -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)
{ }
/// <summary>
/// Change the period between operations.
/// </summary>

View File

@@ -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<ReportSiteTask> logger,
IUmbracoVersion umbracoVersion,
IOptions<GlobalSettings> globalSettings)
: this(logger, StaticServiceProvider.Instance.GetRequiredService<ITelemetryService>())
{
}
/// <summary>
/// Runs the background task to send the anonymous ID
/// to telemetry service

View File

@@ -43,13 +43,6 @@ namespace Umbraco.Cms.Core.Logging.Viewer
bool CheckCanOpenLogs(LogTimePeriod logTimePeriod);
/// <summary>
/// Gets the current Serilog minimum log level
/// </summary>
/// <returns></returns>
[Obsolete("Please use GetLogLevels() instead. Scheduled for removal in V11.")]
string GetLogLevel();
/// <summary>
/// Returns the collection of logs
/// </summary>

View File

@@ -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<ILogLevelLoader>();
_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();
}
/// <summary>
/// Get the Serilog minimum-level value from the config file.
/// </summary>
[Obsolete("Please use LogLevelLoader.GetGlobalMinLogLevel() instead. Scheduled for removal in V11.")]
public string GetLogLevel()
{
var logLevel = Enum.GetValues(typeof(LogEventLevel)).Cast<LogEventLevel>().Where(_serilogLog.IsEnabled).DefaultIfEmpty(LogEventLevel.Information)?.Min() ?? null;
return logLevel?.ToString() ?? string.Empty;
}
public LogLevelCounts GetLogLevelCounts(LogTimePeriod logTimePeriod)
{
var counter = new CountingFilter();

View File

@@ -96,17 +96,6 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install
private readonly IUmbracoVersion _umbracoVersion;
private readonly IOptionsMonitor<InstallDefaultDataSettings> _defaultDataCreationSettings;
[Obsolete("Please use constructor taking all parameters. Scheduled for removal in V11.")]
public DatabaseSchemaCreator(
IUmbracoDatabase? database,
ILogger<DatabaseSchemaCreator> logger,
ILoggerFactory loggerFactory,
IUmbracoVersion umbracoVersion,
IEventAggregator eventAggregator)
: this (database, logger, loggerFactory, umbracoVersion, eventAggregator, StaticServiceProvider.Instance.GetRequiredService<IOptionsMonitor<InstallDefaultDataSettings>>())
{
}
public DatabaseSchemaCreator(
IUmbracoDatabase? database,
ILogger<DatabaseSchemaCreator> logger,

View File

@@ -21,16 +21,6 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install
private readonly IEventAggregator _eventAggregator;
private readonly IOptionsMonitor<InstallDefaultDataSettings> _installDefaultDataSettings;
[Obsolete("Please use the constructor taking all parameters. Scheduled for removal in V11.")]
public DatabaseSchemaCreatorFactory(
ILogger<DatabaseSchemaCreator> logger,
ILoggerFactory loggerFactory,
IUmbracoVersion umbracoVersion,
IEventAggregator eventAggregator)
: this(logger, loggerFactory, umbracoVersion, eventAggregator, StaticServiceProvider.Instance.GetRequiredService<IOptionsMonitor<InstallDefaultDataSettings>>())
{
}
public DatabaseSchemaCreatorFactory(
ILogger<DatabaseSchemaCreator> logger,
ILoggerFactory loggerFactory,

View File

@@ -77,9 +77,11 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
.From<PropertyTypeDto>()
.Where<PropertyTypeDto>(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();

View File

@@ -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<PackageMigrationSettings> options) : base(packagingService, mediaService, mediaFileManager, mediaUrlGenerators, shortStringHelper, contentTypeBaseServiceProvider, context, options)
{
}

View File

@@ -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)
{

View File

@@ -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<IOptions<PackageMigrationSettings>>())
{
}
public IImportPackageBuilder ImportPackage => BeginBuild(
new ImportPackageBuilder(
_packagingService,

View File

@@ -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()
{

View File

@@ -17,24 +17,12 @@ using Umbraco.Extensions;
namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
{
internal class ExternalLoginRepository : EntityRepositoryBase<int, IIdentityUserLogin>, IExternalLoginRepository, IExternalLoginWithKeyRepository
internal class ExternalLoginRepository : EntityRepositoryBase<int, IIdentityUserLogin>, IExternalLoginWithKeyRepository
{
public ExternalLoginRepository(IScopeAccessor scopeAccessor, AppCaches cache, ILogger<ExternalLoginRepository> logger)
: base(scopeAccessor, cache, logger)
{ }
/// <inheritdoc />
[Obsolete("Use method that takes guid as param")]
public void DeleteUserLogins(int memberId) => DeleteUserLogins(memberId.ToGuid());
/// <inheritdoc />
[Obsolete("Use method that takes guid as param")]
public void Save(int userId, IEnumerable<IExternalLogin> logins) => Save(userId.ToGuid(), logins);
/// <inheritdoc />
[Obsolete("Use method that takes guid as param")]
public void Save(int userId, IEnumerable<IExternalLoginToken> tokens) => Save(userId.ToGuid(), tokens);
/// <inheritdoc />
public void DeleteUserLogins(Guid userOrMemberKey) => Database.Delete<ExternalLoginDto>("WHERE userOrMemberKey=@userOrMemberKey", new { userOrMemberKey });

View File

@@ -18,7 +18,7 @@ using Umbraco.Extensions;
namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
{
internal class MacroRepository : EntityRepositoryBase<int, IMacro>, IMacroWithAliasRepository
internal class MacroRepository : EntityRepositoryBase<int, IMacro>, IMacroRepository
{
private readonly IShortStringHelper _shortStringHelper;
private readonly IRepositoryCachePolicy<IMacro, string> _macroByAliasCachePolicy;

View File

@@ -210,14 +210,6 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
return Database.ExecuteScalar<int>(fullSql);
}
/// <inheritdoc />
[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)
{
}
/// <summary>
/// Gets paged member results.
/// </summary>

View File

@@ -692,11 +692,6 @@ SELECT 4 AS [Key], COUNT(id) AS [Value] FROM umbracoUser WHERE userDisabled = 0
return Database.ExecuteScalar<int>(sql);
}
public bool Exists(string username)
{
return ExistsByUserName(username);
}
public bool ExistsByUserName(string username)
{
var sql = SqlContext.Sql()

View File

@@ -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();

View File

@@ -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> globalSettings,
IUmbracoMapper mapper,
BackOfficeErrorDescriber describer,
AppCaches appCaches)
: this(
scopeProvider,
userService,
entityService,
StaticServiceProvider.Instance.GetRequiredService<IExternalLoginWithKeyService>(),
StaticServiceProvider.Instance.GetRequiredService<IOptionsSnapshot<GlobalSettings>>(),
mapper,
describer,
appCaches,
StaticServiceProvider.Instance.GetRequiredService<ITwoFactorLoginService>())
{
}
/// <inheritdoc />
public override async Task<bool> GetTwoFactorEnabledAsync(BackOfficeIdentityUser user,
CancellationToken cancellationToken = default(CancellationToken))

View File

@@ -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<IExternalLoginWithKeyService>(), StaticServiceProvider.Instance.GetRequiredService<ITwoFactorLoginService>())
{

View File

@@ -74,7 +74,7 @@ namespace Umbraco.Cms.Infrastructure.Templates
private IEnumerable<UmbracoEntityReference> GetUmbracoEntityReferencesFromMacros(List<Tuple<string?, Dictionary<string, string>>> macros)
{
if (_macroService is not IMacroWithAliasService macroWithAliasService)
if (_macroService is not IMacroService macroWithAliasService)
{
yield break;
}

View File

@@ -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)
{

View File

@@ -9,16 +9,6 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource
/// </summary>
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<string, PropertyData[]>? properties, IReadOnlyDictionary<string, CultureVariation>? 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<string, PropertyData[]> Properties { get; [Obsolete("Do not change this, use ctor with params and have this object immutable.")] set; }
public IDictionary<string, PropertyData[]> Properties { get; }
/// <summary>
/// The collection of language Id to name for the content item
/// </summary>
public IReadOnlyDictionary<string, CultureVariation>? CultureInfos { get; [Obsolete("Do not change this, use ctor with params and have this object immutable.")] set; }
public IReadOnlyDictionary<string, CultureVariation>? CultureInfos { get; }
}
}

View File

@@ -290,7 +290,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
},
{
"memberTypeApiBaseUrl", _linkGenerator.GetUmbracoApiServiceBaseUrl<MemberTypeController>(
controller => controller.GetAllTypes())
controller => controller.GetById(0))
},
{
"memberTypeQueryApiBaseUrl", _linkGenerator.GetUmbracoApiServiceBaseUrl<MemberTypeQueryController>(

View File

@@ -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> contentSettings,
IHostingEnvironment hostingEnvironment,
IImageUrlGenerator imageUrlGenerator,
IBackOfficeSecurityAccessor backofficeSecurityAccessor,
IUserService userService,
IUmbracoMapper umbracoMapper,
IBackOfficeUserManager backOfficeUserManager,
ILoggerFactory loggerFactory,
ILocalizedTextService localizedTextService,
AppCaches appCaches,
IShortStringHelper shortStringHelper,
IPasswordChanger<BackOfficeIdentityUser> passwordChanger) : this(
mediaFileManager,
StaticServiceProvider.Instance.GetRequiredService<IOptionsSnapshot<ContentSettings>>(),
hostingEnvironment,
imageUrlGenerator,
backofficeSecurityAccessor,
userService,
umbracoMapper,
backOfficeUserManager,
localizedTextService,
appCaches,
shortStringHelper,
passwordChanger,
StaticServiceProvider.Instance.GetRequiredService<IUserDataService>())
{
}
/// <summary>
/// Returns permissions for all nodes passed in for the current user
/// </summary>

View File

@@ -476,46 +476,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
}).ToDictionary(x => x.Id, x => x.Url);
}
/// <summary>
/// Get entity URLs by UDIs
/// </summary>
/// <param name="udis">
/// A list of UDIs to lookup items by
/// </param>
/// <param name="culture">The culture to fetch the URL for</param>
/// <returns>Dictionary mapping Udi -> Url</returns>
/// <remarks>
/// We allow for POST because there could be quite a lot of Ids.
/// </remarks>
[HttpGet]
[HttpPost]
[Obsolete("Use GetUrlsByIds instead.")]
public IDictionary<Udi, string?> GetUrlsByUdis([FromJsonPath] Udi[] udis, string? culture = null)
{
if (udis == null || !udis.Any())
{
return new Dictionary<Udi, string?>();
}
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);
}
/// <summary>
/// Gets the URL of an entity
/// </summary>

View File

@@ -22,12 +22,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
private readonly ILogger<HelpController> _logger;
private HelpPageSettings? _helpPageSettings;
[Obsolete("Use constructor that takes IOptions<HelpPageSettings>")]
public HelpController(ILogger<HelpController> logger)
: this(logger, StaticServiceProvider.Instance.GetRequiredService<IOptionsMonitor<HelpPageSettings>>())
{
}
[ActivatorUtilitiesConstructor]
public HelpController(
ILogger<HelpController> logger,

View File

@@ -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> globalSettings)
: this(localizationService, umbracoMapper)
{ }
/// <summary>
/// Returns all cultures available for creating languages.
/// </summary>

View File

@@ -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<ILogLevelLoader>())
{
}
[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();
}
}
}

View File

@@ -1096,32 +1096,5 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
return new ActionResult<IMedia>(toMove);
}
[Obsolete("Please use TrackedReferencesController.GetPagedRelationsForItem() instead. Scheduled for removal in V11.")]
public PagedResult<EntityBasic> 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<EntityBasic>(totalRecords, pageNumber, pageSize)
{
Items = relations.Cast<ContentEntitySlim>().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
})
};
}
}
}

View File

@@ -178,18 +178,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
return dto;
}
/// <summary>
/// Returns all member types
/// </summary>
[Obsolete("Use MemberTypeQueryController.GetAllTypes instead as it only requires AuthorizationPolicies.TreeAccessMembersOrMemberTypes and not both this and AuthorizationPolicies.TreeAccessMemberTypes")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMembersOrMemberTypes)]
public IEnumerable<ContentTypeBasic> GetAllTypes()
{
return _memberTypeService.GetAll()
.Select(_umbracoMapper.Map<IMemberType, ContentTypeBasic>).WhereNotNull();
}
public ActionResult<MemberTypeDisplay?> PostSave(MemberTypeSave contentTypeSave)
{
//get the persisted member type

View File

@@ -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<IDefaultViewContentProvider>())
{
}
/// <summary>
/// Gets data type by alias
/// </summary>

View File

@@ -19,7 +19,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
{
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
private readonly ILogger<TwoFactorLoginController> _logger;
private readonly ITwoFactorLoginService2 _twoFactorLoginService;
private readonly ITwoFactorLoginService _twoFactorLoginService;
private readonly IBackOfficeSignInManager _backOfficeSignInManager;
private readonly IBackOfficeUserManager _backOfficeUserManager;
private readonly IOptionsSnapshot<TwoFactorLoginViewOptions> _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;

View File

@@ -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<IMemberTypeService>())
{
}
protected override ActionResult<TreeNodeCollection> GetTreeNodes(string id, FormCollection queryStrings)
{
var nodes = new TreeNodeCollection();

View File

@@ -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);
}

View File

@@ -52,41 +52,6 @@ public class UmbracoRequestMiddleware : IMiddleware
private readonly IVariationContextAccessor _variationContextAccessor;
private SmidgeOptions _smidgeOptions;
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoRequestMiddleware" /> class.
/// </summary>
// Obsolete, scheduled for removal in V11
[Obsolete("Use constructor that takes an IOptions<UmbracoRequestOptions>")]
public UmbracoRequestMiddleware(
ILogger<UmbracoRequestMiddleware> logger,
IUmbracoContextFactory umbracoContextFactory,
IRequestCache requestCache,
IEventAggregator eventAggregator,
IProfiler profiler,
IHostingEnvironment hostingEnvironment,
UmbracoRequestPaths umbracoRequestPaths,
BackOfficeWebAssets backOfficeWebAssets,
IOptionsMonitor<SmidgeOptions> smidgeOptions,
IRuntimeState runtimeState,
IVariationContextAccessor variationContextAccessor,
IDefaultCultureAccessor defaultCultureAccessor)
: this(
logger,
umbracoContextFactory,
requestCache,
eventAggregator,
profiler,
hostingEnvironment,
umbracoRequestPaths,
backOfficeWebAssets,
smidgeOptions,
runtimeState,
variationContextAccessor,
defaultCultureAccessor,
StaticServiceProvider.Instance.GetRequiredService<IOptions<UmbracoRequestOptions>>())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoRequestMiddleware" /> class.
/// </summary>

View File

@@ -157,14 +157,6 @@ public class SmidgeRuntimeMinifier : IRuntimeMinifier
}
}
/// <inheritdoc />
[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();

View File

@@ -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<IISServerOptions>
{
private readonly IOptions<RuntimeSettings> _runtimeSettings;
public ConfigureIISServerOptions(IOptions<RuntimeSettings> 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.
}

View File

@@ -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<IMemberManager>(),
StaticServiceProvider.Instance.GetRequiredService<ITwoFactorLoginService>())
{
}
[HttpPost]
[ValidateAntiForgeryToken]
[ValidateUmbracoFormRouteString]

View File

@@ -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<Assembly> ScanAssemblies = new List<Assembly>();
public static TOptions GetTestOptions<TOptions>(MethodInfo method)
where TOptions : TestOptionAttributeBase, new()
{

View File

@@ -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<PackageMigrationSettings> options) : base(packagingService, mediaService, mediaFileManager, mediaUrlGenerators, shortStringHelper, contentTypeBaseServiceProvider, context, options)
{
}

View File

@@ -776,7 +776,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging
// Act
var contentTypes = PackageDataInstallation
.ImportDocumentType(withoutCleanupPolicy, 0)
.OfType<IContentTypeWithHistoryCleanup>();
.OfType<IContentType>();
// Assert
Assert.Multiple(() =>
@@ -795,7 +795,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging
// Act
var contentTypes = PackageDataInstallation
.ImportDocumentType(docTypeElement, 0)
.OfType<IContentTypeWithHistoryCleanup>();
.OfType<IContentType>();
// Assert
Assert.Multiple(() =>
@@ -817,11 +817,11 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging
// Act
var contentTypes = PackageDataInstallation
.ImportDocumentType(withCleanupPolicy, 0)
.OfType<IContentTypeWithHistoryCleanup>();
.OfType<IContentType>();
var contentTypesUpdated = PackageDataInstallation
.ImportDocumentType(withoutCleanupPolicy, 0)
.OfType<IContentTypeWithHistoryCleanup>();
.OfType<IContentType>();
// Assert
Assert.Multiple(() =>

View File

@@ -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<IMacroService>()")]
private IMacroWithAliasService MacroService => GetRequiredService<IMacroService>() as IMacroWithAliasService;
private IMacroService MacroService => GetRequiredService<IMacroService>();
[SetUp]
public void SetupTest()

View File

@@ -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();

View File

@@ -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 <test> 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)]

View File

@@ -20,7 +20,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.ShortStringHelper
{
var requestHandlerSettings = new RequestHandlerSettings()
{
CharCollection = Array.Empty<CharItem>(),
UserDefinedCharCollection = Array.Empty<CharItem>(),
EnableDefaultCharReplacements = false,
ConvertUrlsToAscii = "false"
};
@@ -47,7 +47,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.ShortStringHelper
{
var requestHandlerSettings = new RequestHandlerSettings()
{
CharCollection = Array.Empty<CharItem>(),
UserDefinedCharCollection = Array.Empty<CharItem>(),
EnableDefaultCharReplacements = false,
ConvertUrlsToAscii = "false"
};
@@ -342,7 +342,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.ShortStringHelper
{
var requestHandlerSettings = new RequestHandlerSettings()
{
CharCollection = Array.Empty<CharItem>(),
UserDefinedCharCollection = Array.Empty<CharItem>(),
EnableDefaultCharReplacements = false,
ConvertUrlsToAscii = "false"
};