Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V14: Deleted code marked as obsolete for V12 and V13 #15999

Merged
merged 9 commits into from
Apr 8, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public static IUmbracoBuilder AddUmbracoManagementApi(this IUmbracoBuilder build
options.AddFilter(new UmbracoPipelineFilter(
"BackOfficeManagementApiFilter",
applicationBuilder => applicationBuilder.UseProblemDetailsExceptionHandling(),
applicationBuilder => { },
applicationBuilder => applicationBuilder.UseEndpoints()));
postPipeline: _ => { },
endpoints: applicationBuilder => applicationBuilder.UseEndpoints()));
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System.Security.Claims;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Web.Common.DependencyInjection;
using Umbraco.Extensions;

namespace Umbraco.Cms.Api.Management.Security;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ public ImageSharpImageUrlGenerator(
{
}

/// <summary>
/// Initializes a new instance of the <see cref="ImageSharpImageUrlGenerator" /> class.
/// </summary>
/// <param name="configuration">The ImageSharp configuration.</param>
[Obsolete("Use ctor with all params - This will be removed in Umbraco 13.")]
public ImageSharpImageUrlGenerator(Configuration configuration)
: this(configuration, StaticServiceProvider.Instance.GetService<RequestAuthorizationUtilities>(), StaticServiceProvider.Instance.GetRequiredService<IOptions<ImageSharpMiddlewareOptions>>())
{ }

/// <summary>
/// Initializes a new instance of the <see cref="ImageSharpImageUrlGenerator" /> class.
/// </summary>
Expand Down
3 changes: 0 additions & 3 deletions src/Umbraco.Cms.Persistence.Sqlite/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@ public static class Constants
/// SQLite provider name.
/// </summary>
public const string ProviderName = "Microsoft.Data.Sqlite";

[Obsolete("This will be removed in Umbraco 12. Use Constants.ProviderName instead")]
public const string ProviderNameLegacy = "Microsoft.Data.SQLite";
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,11 @@
DbProviderFactories.UnregisterFactory(Constants.ProviderName);
DbProviderFactories.RegisterFactory(Constants.ProviderName, SqliteFactory.Instance);

// Remove this registration in Umbraco 12
DbProviderFactories.UnregisterFactory(Constants.ProviderNameLegacy);
DbProviderFactories.RegisterFactory(Constants.ProviderNameLegacy, SqliteFactory.Instance);

// Prevent accidental creation of SQLite database files
builder.Services.PostConfigureAll<ConnectionStrings>(options =>
{
// Skip empty connection string and other providers
if (!options.IsConnectionStringConfigured() || (options.ProviderName != Constants.ProviderName && options.ProviderName != Constants.ProviderNameLegacy))
if (!options.IsConnectionStringConfigured() || options.ProviderName != Constants.ProviderName)

Check notice on line 53 in src/Umbraco.Cms.Persistence.Sqlite/UmbracoBuilderExtensions.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v14/dev)

✅ No longer an issue: Complex Conditional

AddUmbracoSqliteSupport no longer has a complex conditional
{
return;
}
Expand Down
52 changes: 0 additions & 52 deletions src/Umbraco.Core/Cache/DistributedCacheExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,9 @@ public static void RemoveDictionaryCache(this DistributedCache dc, IEnumerable<I

#region DataTypeCacheRefresher

[Obsolete("Use the overload accepting IEnumerable instead. This overload will be removed in Umbraco 13.")]
public static void RefreshDataTypeCache(this DistributedCache dc, IDataType dataType)
=> dc.RefreshDataTypeCache(dataType.Yield());

public static void RefreshDataTypeCache(this DistributedCache dc, IEnumerable<IDataType> dataTypes)
=> dc.RefreshByPayload(DataTypeCacheRefresher.UniqueId, dataTypes.DistinctBy(x => (x.Id, x.Key)).Select(x => new DataTypeCacheRefresher.JsonPayload(x.Id, x.Key, false)));

[Obsolete("Use the overload accepting IEnumerable instead. This overload will be removed in Umbraco 13.")]
public static void RemoveDataTypeCache(this DistributedCache dc, IDataType dataType)
=> dc.RemoveDataTypeCache(dataType.Yield());

public static void RemoveDataTypeCache(this DistributedCache dc, IEnumerable<IDataType> dataTypes)
=> dc.RefreshByPayload(DataTypeCacheRefresher.UniqueId, dataTypes.DistinctBy(x => (x.Id, x.Key)).Select(x => new DataTypeCacheRefresher.JsonPayload(x.Id, x.Key, true)));

Expand Down Expand Up @@ -131,10 +123,6 @@ public static void RefreshAllContentCache(this DistributedCache dc)
dc.RefreshByPayload(ContentCacheRefresher.UniqueId, payloads);
}

[Obsolete("Use the overload accepting IEnumerable instead to avoid allocating arrays. This overload will be removed in Umbraco 13.")]
public static void RefreshContentCache(this DistributedCache dc, TreeChange<IContent>[] changes)
=> dc.RefreshContentCache(changes.AsEnumerable());

public static void RefreshContentCache(this DistributedCache dc, IEnumerable<TreeChange<IContent>> changes)
{
IEnumerable<ContentCacheRefresher.JsonPayload> payloads = changes.Select(x => new ContentCacheRefresher.JsonPayload()
Expand All @@ -152,18 +140,9 @@ public static void RefreshContentCache(this DistributedCache dc, IEnumerable<Tre

#region MemberCacheRefresher

[Obsolete("Use the overload accepting IEnumerable instead to avoid allocating arrays. This overload will be removed in Umbraco 13.")]
public static void RefreshMemberCache(this DistributedCache dc, params IMember[] members)
=> dc.RefreshMemberCache(members.AsEnumerable());

public static void RefreshMemberCache(this DistributedCache dc, IEnumerable<IMember> members)
=> dc.RefreshByPayload(MemberCacheRefresher.UniqueId, members.DistinctBy(x => (x.Id, x.Username)).Select(x => new MemberCacheRefresher.JsonPayload(x.Id, x.Username, false)));


[Obsolete("Use the overload accepting IEnumerable instead to avoid allocating arrays. This overload will be removed in Umbraco 13.")]
public static void RemoveMemberCache(this DistributedCache dc, params IMember[] members)
=> dc.RemoveMemberCache(members.AsEnumerable());

public static void RemoveMemberCache(this DistributedCache dc, IEnumerable<IMember> members)
=> dc.RefreshByPayload(MemberCacheRefresher.UniqueId, members.DistinctBy(x => (x.Id, x.Username)).Select(x => new MemberCacheRefresher.JsonPayload(x.Id, x.Username, true)));

Expand Down Expand Up @@ -191,9 +170,6 @@ public static void RefreshAllMediaCache(this DistributedCache dc)
// note: refresh all media cache does refresh content types too
=> dc.RefreshByPayload(MediaCacheRefresher.UniqueId, new MediaCacheRefresher.JsonPayload(0, null, TreeChangeTypes.RefreshAll).Yield());

[Obsolete("Use the overload accepting IEnumerable instead to avoid allocating arrays. This overload will be removed in Umbraco 13.")]
public static void RefreshMediaCache(this DistributedCache dc, TreeChange<IMedia>[] changes)
=> dc.RefreshMediaCache(changes.AsEnumerable());

public static void RefreshMediaCache(this DistributedCache dc, IEnumerable<TreeChange<IMedia>> changes)
=> dc.RefreshByPayload(MediaCacheRefresher.UniqueId, changes.DistinctBy(x => (x.Item.Id, x.Item.Key, x.ChangeTypes)).Select(x => new MediaCacheRefresher.JsonPayload(x.Item.Id, x.Item.Key, x.ChangeTypes)));
Expand All @@ -214,42 +190,22 @@ public static void RefreshAllPublishedSnapshot(this DistributedCache dc)

#region ContentTypeCacheRefresher

[Obsolete("Use the overload accepting IEnumerable instead to avoid allocating arrays. This overload will be removed in Umbraco 13.")]
public static void RefreshContentTypeCache(this DistributedCache dc, ContentTypeChange<IContentType>[] changes)
=> dc.RefreshContentTypeCache(changes.AsEnumerable());

public static void RefreshContentTypeCache(this DistributedCache dc, IEnumerable<ContentTypeChange<IContentType>> changes)
=> dc.RefreshByPayload(ContentTypeCacheRefresher.UniqueId, changes.DistinctBy(x => (x.Item.Id, x.ChangeTypes)).Select(x => new ContentTypeCacheRefresher.JsonPayload(typeof(IContentType).Name, x.Item.Id, x.ChangeTypes)));

[Obsolete("Use the overload accepting IEnumerable instead to avoid allocating arrays. This overload will be removed in Umbraco 13.")]
public static void RefreshContentTypeCache(this DistributedCache dc, ContentTypeChange<IMediaType>[] changes)
=> dc.RefreshContentTypeCache(changes.AsEnumerable());

public static void RefreshContentTypeCache(this DistributedCache dc, IEnumerable<ContentTypeChange<IMediaType>> changes)
=> dc.RefreshByPayload(ContentTypeCacheRefresher.UniqueId, changes.DistinctBy(x => (x.Item.Id, x.ChangeTypes)).Select(x => new ContentTypeCacheRefresher.JsonPayload(typeof(IMediaType).Name, x.Item.Id, x.ChangeTypes)));

[Obsolete("Use the overload accepting IEnumerable instead to avoid allocating arrays. This overload will be removed in Umbraco 13.")]
public static void RefreshContentTypeCache(this DistributedCache dc, ContentTypeChange<IMemberType>[] changes)
=> dc.RefreshContentTypeCache(changes.AsEnumerable());

public static void RefreshContentTypeCache(this DistributedCache dc, IEnumerable<ContentTypeChange<IMemberType>> changes)
=> dc.RefreshByPayload(ContentTypeCacheRefresher.UniqueId, changes.DistinctBy(x => (x.Item.Id, x.ChangeTypes)).Select(x => new ContentTypeCacheRefresher.JsonPayload(typeof(IMemberType).Name, x.Item.Id, x.ChangeTypes)));

#endregion

#region DomainCacheRefresher

[Obsolete("Use the overload accepting IEnumerable instead. This overload will be removed in Umbraco 13.")]
public static void RefreshDomainCache(this DistributedCache dc, IDomain domain)
=> dc.RefreshDomainCache(domain.Yield());

public static void RefreshDomainCache(this DistributedCache dc, IEnumerable<IDomain> domains)
=> dc.RefreshByPayload(DomainCacheRefresher.UniqueId, domains.DistinctBy(x => x.Id).Select(x => new DomainCacheRefresher.JsonPayload(x.Id, DomainChangeTypes.Refresh)));

[Obsolete("Use the overload accepting IEnumerable instead. This overload will be removed in Umbraco 13.")]
public static void RemoveDomainCache(this DistributedCache dc, IDomain domain)
=> dc.RemoveDomainCache(domain.Yield());

public static void RemoveDomainCache(this DistributedCache dc, IEnumerable<IDomain> domains)
=> dc.RefreshByPayload(DomainCacheRefresher.UniqueId, domains.DistinctBy(x => x.Id).Select(x => new DomainCacheRefresher.JsonPayload(x.Id, DomainChangeTypes.Remove)));

Expand All @@ -260,10 +216,6 @@ public static void RefreshAllDomainCache(this DistributedCache dc)

#region LanguageCacheRefresher

[Obsolete("Use the overload accepting IEnumerable instead. This overload will be removed in Umbraco 13.")]
public static void RefreshLanguageCache(this DistributedCache dc, ILanguage language)
=> dc.RefreshLanguageCache(language.Yield());

public static void RefreshLanguageCache(this DistributedCache dc, IEnumerable<ILanguage> languages)
=> dc.RefreshByPayload(LanguageCacheRefresher.UniqueId, languages.DistinctBy(x => (x.Id, x.IsoCode)).Select(x => new LanguageCacheRefresher.JsonPayload(
x.Id,
Expand All @@ -272,10 +224,6 @@ public static void RefreshLanguageCache(this DistributedCache dc, IEnumerable<IL
? LanguageCacheRefresher.JsonPayload.LanguageChangeType.ChangeCulture
: LanguageCacheRefresher.JsonPayload.LanguageChangeType.Update)));

[Obsolete("Use the overload accepting IEnumerable instead. This overload will be removed in Umbraco 13.")]
public static void RemoveLanguageCache(this DistributedCache dc, ILanguage language)
=> dc.RemoveLanguageCache(language.Yield());

public static void RemoveLanguageCache(this DistributedCache dc, IEnumerable<ILanguage> languages)
=> dc.RefreshByPayload(LanguageCacheRefresher.UniqueId, languages.DistinctBy(x => (x.Id, x.IsoCode)).Select(x => new LanguageCacheRefresher.JsonPayload(x.Id, x.IsoCode, LanguageCacheRefresher.JsonPayload.LanguageChangeType.Remove)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public void Configure(string? name, ConnectionStrings options)
return;
}

options.Name = name;
options.ConnectionString = _configuration.GetUmbracoConnectionString(name, out string? providerName);
options.ProviderName = providerName ??
ConnectionStrings.DefaultProviderName;
Expand Down
6 changes: 0 additions & 6 deletions src/Umbraco.Core/Configuration/ITypeFinderSettings.cs

This file was deleted.

17 changes: 0 additions & 17 deletions src/Umbraco.Core/Configuration/Models/ActiveDirectorySettings.cs

This file was deleted.

9 changes: 0 additions & 9 deletions src/Umbraco.Core/Configuration/Models/ConnectionStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ public class ConnectionStrings // TODO: Rename to [Umbraco]ConnectionString (sin
/// </summary>
public const string ProviderNamePostfix = ConfigurationExtensions.ProviderNamePostfix;

/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
[Obsolete("This property will be removed in Umbraco 12, because this class is now using named options.")]
public string? Name { get; set; }

/// <summary>
/// Gets or sets the connection string.
/// </summary>
Expand Down
13 changes: 0 additions & 13 deletions src/Umbraco.Core/Configuration/Models/ContentSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,19 +186,6 @@ @keyframes umbraco-preview-badge--effect {{
[DefaultValue(StaticDefaultPreviewBadge)]
public string PreviewBadge { get; set; } = StaticDefaultPreviewBadge;

/// <summary>
/// Gets or sets a value for the collection of file extensions that are disallowed for upload.
/// </summary>
[DefaultValue(StaticDisallowedUploadFiles)]
[Obsolete("Please use DisAllowedUploadedFileExtensions instead, scheduled for removal in V13")]
public IEnumerable<string> DisallowedUploadFiles { get; set; } = StaticDisallowedUploadFiles.Split(',');

/// <summary>
/// Gets or sets a value for the collection of file extensions that are allowed for upload.
/// </summary>
[Obsolete("Please use AllowedUploadedFileExtensions instead, scheduled for removal in V13")]
public IEnumerable<string> AllowedUploadFiles { get; set; } = Array.Empty<string>();

/// <summary>
/// Gets or sets a value indicating whether deprecated property editors should be shown.
/// </summary>
Expand Down
12 changes: 0 additions & 12 deletions src/Umbraco.Core/Configuration/Models/SecuritySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,6 @@ public class SecuritySettings
[DefaultValue(StaticAllowedUserNameCharacters)]
public string AllowedUserNameCharacters { get; set; } = StaticAllowedUserNameCharacters;

/// <summary>
/// Gets or sets a value for the user password settings.
/// </summary>
[Obsolete("This no longer works. You can now inject this by using IOptions<UserPasswordConfigurationSettings> instead, scheduled for removal in v13")]
public UserPasswordConfigurationSettings? UserPassword { get; set; } = new();

/// <summary>
/// Gets or sets a value for the member password settings.
/// </summary>
[Obsolete("This no longer works. You can now inject this by using IOptions<MemberPasswordConfigurationSettings> instead, scheduled for removal in v13")]
public MemberPasswordConfigurationSettings? MemberPassword { get; set; } = new();

/// <summary>
/// Gets or sets a value indicating whether to bypass the two factor requirement in Umbraco when using external login
/// for members. Thereby rely on the External login and potential 2FA at that provider.
Expand Down
15 changes: 0 additions & 15 deletions src/Umbraco.Core/Constants-PackageRepository.cs

This file was deleted.

This file was deleted.

Loading
Loading