From e53d6eed9ac589ce995d5e4c18eaaa05b35eee24 Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 12:47:16 +0200 Subject: [PATCH 01/18] Removing obsoleted constructor from SubTypesSelector.cs --- .../OpenApi/SubTypesSelector.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Umbraco.Cms.Api.Common/OpenApi/SubTypesSelector.cs b/src/Umbraco.Cms.Api.Common/OpenApi/SubTypesSelector.cs index 947e7a8197ef..3e4d1a629504 100644 --- a/src/Umbraco.Cms.Api.Common/OpenApi/SubTypesSelector.cs +++ b/src/Umbraco.Cms.Api.Common/OpenApi/SubTypesSelector.cs @@ -15,20 +15,6 @@ public class SubTypesSelector : ISubTypesSelector private readonly IEnumerable _subTypeHandlers; private readonly IUmbracoJsonTypeInfoResolver _umbracoJsonTypeInfoResolver; - [Obsolete("The settings parameter is not required anymore, use the other constructor instead. Scheduled for removal in Umbraco 17.")] - public SubTypesSelector( - IOptions settings, - IHostingEnvironment hostingEnvironment, - IHttpContextAccessor httpContextAccessor, - IEnumerable subTypeHandlers, - IUmbracoJsonTypeInfoResolver umbracoJsonTypeInfoResolver) - { - _hostingEnvironment = hostingEnvironment; - _httpContextAccessor = httpContextAccessor; - _subTypeHandlers = subTypeHandlers; - _umbracoJsonTypeInfoResolver = umbracoJsonTypeInfoResolver; - } - public SubTypesSelector( IHostingEnvironment hostingEnvironment, IHttpContextAccessor httpContextAccessor, From bb705b29659f4373abc02c036af77f07e38d489e Mon Sep 17 00:00:00 2001 From: Nicklas Kramer Date: Thu, 21 Aug 2025 13:39:32 +0200 Subject: [PATCH 02/18] V17 - Removed obsoleted code from Cms.Api.Delivery (#19964) * Removing obsoleted constructors from AncestorsSelector.cs * Removing obsoleted constructors from ChildrenSelector.cs * Removing obsoleted code from DescendantsSelector.cs * Removing obsoleted code from RequestCultureService.cs * Removing obsoleted code from QueryOptionBase.cs --- .../Querying/QueryOptionBase.cs | 24 -------- .../Querying/Selectors/AncestorsSelector.cs | 55 ------------------- .../Querying/Selectors/ChildrenSelector.cs | 21 ------- .../Querying/Selectors/DescendantsSelector.cs | 21 ------- .../Services/RequestCultureService.cs | 6 -- .../DeliveryApi/IRequestCultureService.cs | 3 - 6 files changed, 130 deletions(-) diff --git a/src/Umbraco.Cms.Api.Delivery/Querying/QueryOptionBase.cs b/src/Umbraco.Cms.Api.Delivery/Querying/QueryOptionBase.cs index a01f8ee9af54..761abe36b6f7 100644 --- a/src/Umbraco.Cms.Api.Delivery/Querying/QueryOptionBase.cs +++ b/src/Umbraco.Cms.Api.Delivery/Querying/QueryOptionBase.cs @@ -14,30 +14,6 @@ public abstract class QueryOptionBase private readonly IApiDocumentUrlService _apiDocumentUrlService; private readonly IVariationContextAccessor _variationContextAccessor; - [Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")] - public QueryOptionBase( - IPublishedContentCache publishedContentCache, - IRequestRoutingService requestRoutingService) - : this( - requestRoutingService, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")] - public QueryOptionBase( - IPublishedContentCache publishedContentCache, - IRequestRoutingService requestRoutingService, - IRequestPreviewService requestPreviewService, - IRequestCultureService requestCultureService, - IApiDocumentUrlService apiDocumentUrlService, - IVariationContextAccessor variationContextAccessor) - : this(requestRoutingService, requestPreviewService, apiDocumentUrlService, variationContextAccessor) - { - } - public QueryOptionBase( IRequestRoutingService requestRoutingService, IRequestPreviewService requestPreviewService, diff --git a/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/AncestorsSelector.cs b/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/AncestorsSelector.cs index b3a8dca0d6af..c0a4d4909e16 100644 --- a/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/AncestorsSelector.cs +++ b/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/AncestorsSelector.cs @@ -1,9 +1,6 @@ -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Api.Delivery.Indexing.Selectors; using Umbraco.Cms.Core.DeliveryApi; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models.PublishedContent; -using Umbraco.Cms.Core.PublishedCache; using Umbraco.Cms.Core.Services.Navigation; namespace Umbraco.Cms.Api.Delivery.Querying.Selectors; @@ -13,46 +10,6 @@ public sealed class AncestorsSelector : QueryOptionBase, ISelectorHandler private readonly IDocumentNavigationQueryService _navigationQueryService; private const string AncestorsSpecifier = "ancestors:"; - [Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")] - public AncestorsSelector( - IPublishedContentCache publishedContentCache, - IRequestRoutingService requestRoutingService, - IDocumentNavigationQueryService navigationQueryService, - IRequestPreviewService requestPreviewService) - : this( - requestRoutingService, - requestPreviewService, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - navigationQueryService) - { - } - - [Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")] - public AncestorsSelector( - IPublishedContentCache publishedContentCache, - IRequestRoutingService requestRoutingService, - IDocumentNavigationQueryService navigationQueryService) - : this( - requestRoutingService, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - navigationQueryService) - { - } - - [Obsolete("Use the constructor that takes all parameters. Scheduled for removal in V17.")] - public AncestorsSelector(IPublishedContentCache publishedContentCache, IRequestRoutingService requestRoutingService) - : this( - requestRoutingService, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - public AncestorsSelector( IRequestRoutingService requestRoutingService, IRequestPreviewService requestPreviewService, @@ -62,18 +19,6 @@ public AncestorsSelector( : base(requestRoutingService, requestPreviewService, apiDocumentUrlService, variationContextAccessor) => _navigationQueryService = navigationQueryService; - [Obsolete("Use the constructor that takes all parameters. Scheduled for removal in V17.")] - public AncestorsSelector( - IRequestRoutingService requestRoutingService, - IPublishedContentCache publishedContentCache, - IRequestPreviewService requestPreviewService, - IApiDocumentUrlService apiDocumentUrlService, - IVariationContextAccessor variationContextAccessor, - IDocumentNavigationQueryService navigationQueryService) - : this(requestRoutingService, requestPreviewService, apiDocumentUrlService, variationContextAccessor, navigationQueryService) - { - } - /// public bool CanHandle(string query) => query.StartsWith(AncestorsSpecifier, StringComparison.OrdinalIgnoreCase); diff --git a/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/ChildrenSelector.cs b/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/ChildrenSelector.cs index 4040371f6581..7a2fb9323bbe 100644 --- a/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/ChildrenSelector.cs +++ b/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/ChildrenSelector.cs @@ -12,27 +12,6 @@ public sealed class ChildrenSelector : QueryOptionBase, ISelectorHandler { private const string ChildrenSpecifier = "children:"; - [Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")] - public ChildrenSelector(IPublishedContentCache publishedContentCache, IRequestRoutingService requestRoutingService) - : this( - requestRoutingService, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")] - public ChildrenSelector( - IPublishedContentCache publishedContentCache, - IRequestRoutingService requestRoutingService, - IRequestPreviewService requestPreviewService, - IApiDocumentUrlService apiDocumentUrlService, - IVariationContextAccessor variationContextAccessor) - : this(requestRoutingService, requestPreviewService, apiDocumentUrlService, variationContextAccessor) - { - } - public ChildrenSelector( IRequestRoutingService requestRoutingService, IRequestPreviewService requestPreviewService, diff --git a/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/DescendantsSelector.cs b/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/DescendantsSelector.cs index d46d5499b485..eda9a70beb75 100644 --- a/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/DescendantsSelector.cs +++ b/src/Umbraco.Cms.Api.Delivery/Querying/Selectors/DescendantsSelector.cs @@ -12,27 +12,6 @@ public sealed class DescendantsSelector : QueryOptionBase, ISelectorHandler { private const string DescendantsSpecifier = "descendants:"; - [Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")] - public DescendantsSelector(IPublishedContentCache publishedContentCache, IRequestRoutingService requestRoutingService) - : this( - requestRoutingService, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")] - public DescendantsSelector( - IPublishedContentCache publishedContentCache, - IRequestRoutingService requestRoutingService, - IRequestPreviewService requestPreviewService, - IApiDocumentUrlService apiDocumentUrlService, - IVariationContextAccessor variationContextAccessor) - : this(requestRoutingService, requestPreviewService, apiDocumentUrlService, variationContextAccessor) - { - } - public DescendantsSelector( IRequestRoutingService requestRoutingService, IRequestPreviewService requestPreviewService, diff --git a/src/Umbraco.Cms.Api.Delivery/Services/RequestCultureService.cs b/src/Umbraco.Cms.Api.Delivery/Services/RequestCultureService.cs index 696b8b3953d3..5f797ff15b60 100644 --- a/src/Umbraco.Cms.Api.Delivery/Services/RequestCultureService.cs +++ b/src/Umbraco.Cms.Api.Delivery/Services/RequestCultureService.cs @@ -19,12 +19,6 @@ public RequestCultureService(IHttpContextAccessor httpContextAccessor) return ValidLanguageHeaderRegex().IsMatch(acceptLanguage) ? acceptLanguage : null; } - [Obsolete("Use IVariationContextAccessor to manipulate the variation context. Scheduled for removal in V17.")] - public void SetRequestCulture(string culture) - { - // no-op - } - // at the time of writing we're introducing this to get rid of accept-language header values like "en-GB,en-US;q=0.9,en;q=0.8", // so we don't want to be too restrictive in this regex - keep it simple for now. [GeneratedRegex(@"^[\w-]*$")] diff --git a/src/Umbraco.Core/DeliveryApi/IRequestCultureService.cs b/src/Umbraco.Core/DeliveryApi/IRequestCultureService.cs index 431ad7e5b132..7295d865b6bc 100644 --- a/src/Umbraco.Core/DeliveryApi/IRequestCultureService.cs +++ b/src/Umbraco.Core/DeliveryApi/IRequestCultureService.cs @@ -6,7 +6,4 @@ public interface IRequestCultureService /// Gets the requested culture from the "Accept-Language" header, if present. /// string? GetRequestedCulture(); - - [Obsolete("Use IVariationContextAccessor to manipulate the variation context. Scheduled for removal in V17.")] - void SetRequestCulture(string culture); } From a9af8630b12fc3310efae3b7d90b45416bfc676c Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:10:07 +0200 Subject: [PATCH 03/18] Removing obsoleted code from BackOfficeApplicationManager.cs & Dependencies --- .../Security/BackOfficeDefaultController.cs | 6 ------ ...ckOfficeAuthorizationInitializationMiddleware.cs | 12 ------------ .../Security/BackOfficeApplicationManager.cs | 7 +------ .../Security/BackOfficeExternalLoginProviders.cs | 13 ------------- 4 files changed, 1 insertion(+), 37 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeDefaultController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeDefaultController.cs index da6ab4b18a9a..195963ff8e1f 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeDefaultController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeDefaultController.cs @@ -17,12 +17,6 @@ public class BackOfficeDefaultController : Controller public BackOfficeDefaultController(IRuntime umbracoRuntime) => _umbracoRuntime = umbracoRuntime; - [Obsolete("Use the non obsoleted constructor instead. Scheduled to be removed in v17")] - public BackOfficeDefaultController() - : this(StaticServiceProvider.Instance.GetRequiredService()) - { - } - [HttpGet] [AllowAnonymous] public async Task Index(CancellationToken cancellationToken) diff --git a/src/Umbraco.Cms.Api.Management/Middleware/BackOfficeAuthorizationInitializationMiddleware.cs b/src/Umbraco.Cms.Api.Management/Middleware/BackOfficeAuthorizationInitializationMiddleware.cs index 5bf884899c9c..f5d6ef66f185 100644 --- a/src/Umbraco.Cms.Api.Management/Middleware/BackOfficeAuthorizationInitializationMiddleware.cs +++ b/src/Umbraco.Cms.Api.Management/Middleware/BackOfficeAuthorizationInitializationMiddleware.cs @@ -21,18 +21,6 @@ public class BackOfficeAuthorizationInitializationMiddleware : IMiddleware private readonly IRuntimeState _runtimeState; private readonly WebRoutingSettings _webRoutingSettings; - [Obsolete("Use the non-obsolete constructor. This will be removed in Umbraco 17.")] - public BackOfficeAuthorizationInitializationMiddleware( - UmbracoRequestPaths umbracoRequestPaths, - IServiceProvider serviceProvider, - IRuntimeState runtimeState, - IOptions globalSettings, - IOptions webRoutingSettings, - IHostingEnvironment hostingEnvironment) - : this(umbracoRequestPaths, serviceProvider, runtimeState, webRoutingSettings) - { - } - public BackOfficeAuthorizationInitializationMiddleware( UmbracoRequestPaths umbracoRequestPaths, IServiceProvider serviceProvider, diff --git a/src/Umbraco.Cms.Api.Management/Security/BackOfficeApplicationManager.cs b/src/Umbraco.Cms.Api.Management/Security/BackOfficeApplicationManager.cs index f748a5ab75ae..53ac13b077a9 100644 --- a/src/Umbraco.Cms.Api.Management/Security/BackOfficeApplicationManager.cs +++ b/src/Umbraco.Cms.Api.Management/Security/BackOfficeApplicationManager.cs @@ -32,10 +32,6 @@ public BackOfficeApplicationManager( _authorizeCallbackLogoutPathName = securitySettings.Value.AuthorizeCallbackLogoutPathName; } - [Obsolete("Please use the overload that allows for multiple back-office hosts. Will be removed in V17.")] - public async Task EnsureBackOfficeApplicationAsync(Uri backOfficeUrl, CancellationToken cancellationToken = default) - => await EnsureBackOfficeApplicationAsync([backOfficeUrl], cancellationToken); - public async Task EnsureBackOfficeApplicationAsync(IEnumerable backOfficeHosts, CancellationToken cancellationToken = default) { // Install is okay without this, because we do not need a token to install, @@ -100,8 +96,7 @@ public async Task EnsureBackOfficeClientCredentialsApplicationAsync(string clien public async Task DeleteBackOfficeClientCredentialsApplicationAsync(string clientId, CancellationToken cancellationToken = default) => await Delete(clientId, cancellationToken); - [Obsolete("Do not use - for internal usage only. Will be made internal in V17.")] - public OpenIddictApplicationDescriptor BackofficeOpenIddictApplicationDescriptor(Uri backOfficeUrl) + internal OpenIddictApplicationDescriptor BackofficeOpenIddictApplicationDescriptor(Uri backOfficeUrl) => BackofficeOpenIddictApplicationDescriptor([backOfficeUrl]); internal OpenIddictApplicationDescriptor BackofficeOpenIddictApplicationDescriptor(Uri[] backOfficeHosts) diff --git a/src/Umbraco.Cms.Api.Management/Security/BackOfficeExternalLoginProviders.cs b/src/Umbraco.Cms.Api.Management/Security/BackOfficeExternalLoginProviders.cs index 7ecb178db5f7..c862e1559394 100644 --- a/src/Umbraco.Cms.Api.Management/Security/BackOfficeExternalLoginProviders.cs +++ b/src/Umbraco.Cms.Api.Management/Security/BackOfficeExternalLoginProviders.cs @@ -18,19 +18,6 @@ public class BackOfficeExternalLoginProviders : IBackOfficeExternalLoginProvider private const string ExternalLoginProvidersKey = "Umbraco.Cms.Web.BackOffice.Security.BackOfficeExternalLoginProviders"; - [Obsolete("Please use the constructor taking all parameters. Scheduled for removal in Umbraco 17.")] - public BackOfficeExternalLoginProviders( - IEnumerable externalLogins, - IAuthenticationSchemeProvider authenticationSchemeProvider) - : this( - externalLogins, - authenticationSchemeProvider, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - public BackOfficeExternalLoginProviders( IEnumerable externalLogins, IAuthenticationSchemeProvider authenticationSchemeProvider, From 643bbcaab1c61d278d2aed7b18bd97cf48bf4695 Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:10:39 +0200 Subject: [PATCH 04/18] Removing obsoleted code from ByKeyDocumentController.cs --- .../Document/ByKeyDocumentController.cs | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs index bb90d7f57a7e..3bd5a26f51f6 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs @@ -22,30 +22,6 @@ public class ByKeyDocumentController : DocumentControllerBase private readonly IDocumentPresentationFactory _documentPresentationFactory; private readonly IContentQueryService _contentQueryService; - [Obsolete("Scheduled for removal in v17")] - public ByKeyDocumentController( - IAuthorizationService authorizationService, - IContentEditingService contentEditingService, - IDocumentPresentationFactory documentPresentationFactory) - { - _authorizationService = authorizationService; - _documentPresentationFactory = documentPresentationFactory; - _contentQueryService = StaticServiceProvider.Instance.GetRequiredService(); - } - - // needed for greedy selection until other constructor remains in v17 - [Obsolete("Scheduled for removal in v17")] - public ByKeyDocumentController( - IAuthorizationService authorizationService, - IContentEditingService contentEditingService, - IDocumentPresentationFactory documentPresentationFactory, - IContentQueryService contentQueryService) - { - _authorizationService = authorizationService; - _documentPresentationFactory = documentPresentationFactory; - _contentQueryService = contentQueryService; - } - [ActivatorUtilitiesConstructor] public ByKeyDocumentController( IAuthorizationService authorizationService, From de4cde36a460532bfcd4baae87d14f0314cad79a Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:11:12 +0200 Subject: [PATCH 05/18] Removing obsoleted code from ContentCollectionControllerBase.cs & dependencies --- .../ContentCollectionControllerBase.cs | 33 ------------------- .../DocumentCollectionControllerBase.cs | 6 ---- .../DocumentCollectionPresentationFactory.cs | 9 ----- 3 files changed, 48 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Content/ContentCollectionControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Content/ContentCollectionControllerBase.cs index a38ade606019..f7b540f0341e 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Content/ContentCollectionControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Content/ContentCollectionControllerBase.cs @@ -29,39 +29,6 @@ protected ContentCollectionControllerBase(IUmbracoMapper mapper, SignProviderCol _signProviders = signProvider; } - [Obsolete("Use the constructer with all parameters. To be removed in Umbraco 18")] - protected ContentCollectionControllerBase(IUmbracoMapper mapper) - : this(mapper, StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [Obsolete("This method is no longer used and will be removed in Umbraco 17.")] - protected IActionResult CollectionResult(ListViewPagedModel result) - { - PagedModel collectionItemsResult = result.Items; - ListViewConfiguration collectionConfiguration = result.ListViewConfiguration; - - var collectionPropertyAliases = collectionConfiguration - .IncludeProperties - .Select(p => p.Alias) - .WhereNotNull() - .ToArray(); - - List collectionResponseModels = - _mapper.MapEnumerable(collectionItemsResult.Items, context => - { - context.SetIncludedProperties(collectionPropertyAliases); - }); - - var pageViewModel = new PagedViewModel - { - Items = collectionResponseModels, - Total = collectionItemsResult.Total, - }; - - return Ok(pageViewModel); - } - /// /// Creates a collection result from the provided collection response models and total number of items. /// diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/Collection/DocumentCollectionControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/Collection/DocumentCollectionControllerBase.cs index 8de4daa40187..037308d32f95 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/Collection/DocumentCollectionControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/Collection/DocumentCollectionControllerBase.cs @@ -23,12 +23,6 @@ protected DocumentCollectionControllerBase(IUmbracoMapper mapper, SignProviderCo { } - [Obsolete("Please use the constructor with all parameters. Scheduled to be removed in V18")] - protected DocumentCollectionControllerBase(IUmbracoMapper mapper) - : base(mapper) - { - } - protected IActionResult CollectionOperationStatusResult(ContentCollectionOperationStatus status) => ContentCollectionOperationStatusResult(status, "document"); } diff --git a/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs index b63704cbb260..0aadf6893dbd 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs @@ -14,15 +14,6 @@ public class DocumentCollectionPresentationFactory : ContentCollectionPresentati private readonly IPublicAccessService _publicAccessService; private readonly IEntityService _entityService; - [Obsolete("Please use the non-obsolete constructor. Scheduled for removal in V17.")] - public DocumentCollectionPresentationFactory(IUmbracoMapper mapper, IPublicAccessService publicAccessService) - : this( - mapper, - publicAccessService, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - [ActivatorUtilitiesConstructor] public DocumentCollectionPresentationFactory(IUmbracoMapper mapper, IPublicAccessService publicAccessService, IEntityService entityService) : base(mapper) From 922888d4a8a7ccb5f385ab8674c5527aa3b2e3c7 Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:11:54 +0200 Subject: [PATCH 06/18] Removing obsoleted code from DocumentPresentationFactory.cs --- .../Factories/DocumentPresentationFactory.cs | 78 ------------------- .../Factories/IDocumentPresentationFactory.cs | 13 +--- 2 files changed, 1 insertion(+), 90 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs index f0e3c9901e62..51596fb47666 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs @@ -40,22 +40,6 @@ public DocumentPresentationFactory( _idKeyMap = idKeyMap; } - [Obsolete("Schedule for removal in v17")] - public async Task CreateResponseModelAsync(IContent content) - { - DocumentResponseModel responseModel = _umbracoMapper.Map(content)!; - - Guid? templateKey = content.TemplateId.HasValue - ? _templateService.GetAsync(content.TemplateId.Value).Result?.Key - : null; - - responseModel.Template = templateKey.HasValue - ? new ReferenceByIdModel { Id = templateKey.Value } - : null; - - return responseModel; - } - public async Task CreatePublishedResponseModelAsync(IContent content) { PublishedDocumentResponseModel responseModel = _umbracoMapper.Map(content)!; @@ -148,68 +132,6 @@ public IEnumerable CreateVariantsItemResponseM public DocumentTypeReferenceResponseModel CreateDocumentTypeReferenceResponseModel(IDocumentEntitySlim entity) => _umbracoMapper.Map(entity)!; - [Obsolete("Use CreateCulturePublishScheduleModels instead. Scheduled for removal in v17")] - public Attempt CreateCultureAndScheduleModel(PublishDocumentRequestModel requestModel) - { - var contentScheduleCollection = new ContentScheduleCollection(); - var culturesToPublishImmediately = new HashSet(); - foreach (CultureAndScheduleRequestModel cultureAndScheduleRequestModel in requestModel.PublishSchedules) - { - if (cultureAndScheduleRequestModel.Schedule is null || (cultureAndScheduleRequestModel.Schedule.PublishTime is null && cultureAndScheduleRequestModel.Schedule.UnpublishTime is null)) - { - culturesToPublishImmediately.Add(cultureAndScheduleRequestModel.Culture ?? Constants.System.InvariantCulture); // API have `null` for invariant, but service layer has "*". - continue; - } - - if (cultureAndScheduleRequestModel.Schedule.PublishTime is not null) - { - if (cultureAndScheduleRequestModel.Schedule.PublishTime <= _timeProvider.GetUtcNow()) - { - return Attempt.FailWithStatus(ContentPublishingOperationStatus.PublishTimeNeedsToBeInFuture, new CultureAndScheduleModel() - { - Schedules = contentScheduleCollection, - CulturesToPublishImmediately = culturesToPublishImmediately, - }); - } - - contentScheduleCollection.Add(new ContentSchedule( - cultureAndScheduleRequestModel.Culture ?? Constants.System.InvariantCulture, - cultureAndScheduleRequestModel.Schedule.PublishTime.Value.UtcDateTime, - ContentScheduleAction.Release)); - } - if (cultureAndScheduleRequestModel.Schedule.UnpublishTime is not null) - { - if (cultureAndScheduleRequestModel.Schedule.UnpublishTime <= cultureAndScheduleRequestModel.Schedule.PublishTime) - { - return Attempt.FailWithStatus(ContentPublishingOperationStatus.UnpublishTimeNeedsToBeAfterPublishTime, new CultureAndScheduleModel() - { - Schedules = contentScheduleCollection, - CulturesToPublishImmediately = culturesToPublishImmediately, - }); - } - - if (cultureAndScheduleRequestModel.Schedule.UnpublishTime <= _timeProvider.GetUtcNow()) - { - return Attempt.FailWithStatus(ContentPublishingOperationStatus.UpublishTimeNeedsToBeInFuture, new CultureAndScheduleModel() - { - Schedules = contentScheduleCollection, - CulturesToPublishImmediately = culturesToPublishImmediately, - }); - } - - contentScheduleCollection.Add(new ContentSchedule( - cultureAndScheduleRequestModel.Culture ?? Constants.System.InvariantCulture, - cultureAndScheduleRequestModel.Schedule.UnpublishTime.Value.UtcDateTime, - ContentScheduleAction.Expire)); - } - } - return Attempt.SucceedWithStatus(ContentPublishingOperationStatus.Success, new CultureAndScheduleModel() - { - Schedules = contentScheduleCollection, - CulturesToPublishImmediately = culturesToPublishImmediately, - }); - } - public Attempt, ContentPublishingOperationStatus> CreateCulturePublishScheduleModels(PublishDocumentRequestModel requestModel) { var model = new List(); diff --git a/src/Umbraco.Cms.Api.Management/Factories/IDocumentPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IDocumentPresentationFactory.cs index 34e07940704e..1af214479bb3 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/IDocumentPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/IDocumentPresentationFactory.cs @@ -14,17 +14,9 @@ namespace Umbraco.Cms.Api.Management.Factories; public interface IDocumentPresentationFactory { - [Obsolete("Schedule for removal in v17")] - Task CreateResponseModelAsync(IContent content); - Task CreatePublishedResponseModelAsync(IContent content); - Task CreateResponseModelAsync(IContent content, ContentScheduleCollection schedule) -#pragma warning disable CS0618 // Type or member is obsolete - // Remove when obsolete CreateResponseModelAsync is removed - => CreateResponseModelAsync(content); -#pragma warning restore CS0618 // Type or member is obsolete - + Task CreateResponseModelAsync(IContent content, ContentScheduleCollection schedule); DocumentItemResponseModel CreateItemResponseModel(IDocumentEntitySlim entity); DocumentBlueprintItemResponseModel CreateBlueprintItemResponseModel(IDocumentEntitySlim entity); @@ -33,9 +25,6 @@ Task CreateResponseModelAsync(IContent content, ContentSc DocumentTypeReferenceResponseModel CreateDocumentTypeReferenceResponseModel(IDocumentEntitySlim entity); - [Obsolete("Use CreateCulturePublishScheduleModels instead. Scheduled for removal in v17")] - Attempt CreateCultureAndScheduleModel(PublishDocumentRequestModel requestModel); - Attempt, ContentPublishingOperationStatus> CreateCulturePublishScheduleModels( PublishDocumentRequestModel requestModel) { From db1c1ca5e051dd25ccb831e9103ba64a3078e5d3 Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:13:17 +0200 Subject: [PATCH 07/18] Removing obsoleted code from HealthCheckGroupPresentationFactory.cs & dependencies & IBackOfficeApplicationManager.cs --- .../HealthCheckGroupPresentationFactory.cs | 8 -------- .../IHealthCheckGroupPresentationFactory.cs | 17 +++-------------- .../Security/IBackOfficeApplicationManager.cs | 3 --- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Factories/HealthCheckGroupPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/HealthCheckGroupPresentationFactory.cs index 4f092c151c94..77d0b5f79b44 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/HealthCheckGroupPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/HealthCheckGroupPresentationFactory.cs @@ -41,14 +41,6 @@ public HealthCheckGroupPresentationFactory( return groups; } - [Obsolete("Use CreateHealthCheckGroupWithResultViewModelAsync instead. Will be removed in v17.")] - public HealthCheckGroupWithResultResponseModel CreateHealthCheckGroupWithResultViewModel(IGrouping healthCheckGroup) - => CreateHealthCheckGroupWithResultViewModelAsync(healthCheckGroup).GetAwaiter().GetResult(); - - [Obsolete("Use CreateHealthCheckGroupWithResultViewModelAsync instead. Will be removed in v17.")] - public HealthCheckWithResultPresentationModel CreateHealthCheckWithResultViewModel(HealthCheck healthCheck) => - CreateHealthCheckWithResultViewModelAsync(healthCheck).GetAwaiter().GetResult(); - public async Task CreateHealthCheckGroupWithResultViewModelAsync(IGrouping healthCheckGroup) { var healthChecks = new List(); diff --git a/src/Umbraco.Cms.Api.Management/Factories/IHealthCheckGroupPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IHealthCheckGroupPresentationFactory.cs index fa03c2633a94..76b472d47ac4 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/IHealthCheckGroupPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/IHealthCheckGroupPresentationFactory.cs @@ -7,19 +7,8 @@ public interface IHealthCheckGroupPresentationFactory { IEnumerable> CreateGroupingFromHealthCheckCollection(); - [Obsolete("Use CreateHealthCheckGroupWithResultViewModelAsync instead. Will be removed in v17.")] - HealthCheckGroupWithResultResponseModel CreateHealthCheckGroupWithResultViewModel(IGrouping healthCheckGroup); + Task CreateHealthCheckGroupWithResultViewModelAsync( + IGrouping healthCheckGroup); - [Obsolete("Use CreateHealthCheckGroupWithResultViewModelAsync instead. Will be removed in v17.")] - HealthCheckWithResultPresentationModel CreateHealthCheckWithResultViewModel(HealthCheck healthCheck); - - Task CreateHealthCheckGroupWithResultViewModelAsync(IGrouping healthCheckGroup) -#pragma warning disable CS0618 // Type or member is obsolete - => Task.FromResult(CreateHealthCheckGroupWithResultViewModel(healthCheckGroup)); -#pragma warning restore CS0618 // Type or member is obsolete - - Task CreateHealthCheckWithResultViewModelAsync(HealthCheck healthCheck) -#pragma warning disable CS0618 // Type or member is obsolete - => Task.FromResult(CreateHealthCheckWithResultViewModel(healthCheck)); -#pragma warning restore CS0618 // Type or member is obsolete + Task CreateHealthCheckWithResultViewModelAsync(HealthCheck healthCheck); } diff --git a/src/Umbraco.Infrastructure/Security/IBackOfficeApplicationManager.cs b/src/Umbraco.Infrastructure/Security/IBackOfficeApplicationManager.cs index 57b7bc06bf8c..da8b228f33f1 100644 --- a/src/Umbraco.Infrastructure/Security/IBackOfficeApplicationManager.cs +++ b/src/Umbraco.Infrastructure/Security/IBackOfficeApplicationManager.cs @@ -2,9 +2,6 @@ public interface IBackOfficeApplicationManager { - [Obsolete("Please use the overload that allows for multiple back-office hosts. Will be removed in V17.")] - Task EnsureBackOfficeApplicationAsync(Uri backOfficeUrl, CancellationToken cancellationToken = default); - Task EnsureBackOfficeApplicationAsync(IEnumerable backOfficeHosts, CancellationToken cancellationToken = default) => Task.CompletedTask; From 508dfdc2609b2212b6e17f538c2b5043d1dd4f0c Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:14:31 +0200 Subject: [PATCH 08/18] Removing obsoleted code from DocumentPermissionMapper.cs --- .../Mapping/Permissions/DocumentPermissionMapper.cs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Mapping/Permissions/DocumentPermissionMapper.cs b/src/Umbraco.Cms.Api.Management/Mapping/Permissions/DocumentPermissionMapper.cs index abab7a7fabcd..05fffea7cec5 100644 --- a/src/Umbraco.Cms.Api.Management/Mapping/Permissions/DocumentPermissionMapper.cs +++ b/src/Umbraco.Cms.Api.Management/Mapping/Permissions/DocumentPermissionMapper.cs @@ -22,17 +22,6 @@ public class DocumentPermissionMapper : IPermissionPresentationMapper, IPermissi private readonly Lazy _entityService; private readonly Lazy _userService; - /// - /// Initializes a new instance of the class. - /// - [Obsolete("Please use the constructor taking all parameters. Scheduled for removal in Umbraco 17.")] - public DocumentPermissionMapper() - : this( - StaticServiceProvider.Instance.GetRequiredService>(), - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - /// /// Initializes a new instance of the class. /// From 6f87b38a05b0e53807bf3b02d551d617bafc3968 Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:14:47 +0200 Subject: [PATCH 09/18] Removing obsoleted code from DocumentResponseModel.cs --- .../ViewModels/Document/DocumentResponseModel.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentResponseModel.cs index 8338c2ccf91f..33368a2a2476 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentResponseModel.cs @@ -2,9 +2,6 @@ namespace Umbraco.Cms.Api.Management.ViewModels.Document; public class DocumentResponseModel : DocumentResponseModelBase { - [Obsolete("This property is no longer populated. Please use /document/{id}/urls instead to retrieve the URLs for a document. Scheduled for removal in Umbraco 17.")] - public IEnumerable Urls { get; set; } = Enumerable.Empty(); - public ReferenceByIdModel? Template { get; set; } public bool IsTrashed { get; set; } From 7aa8ac7c05873bb49838100ca1fff517b2ca6b26 Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:15:00 +0200 Subject: [PATCH 10/18] Removing obsoleted code from ExecuteTemplateQueryController.cs --- .../Query/ExecuteTemplateQueryController.cs | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Template/Query/ExecuteTemplateQueryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Template/Query/ExecuteTemplateQueryController.cs index 07063b69f7df..7e1fa743fb42 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Template/Query/ExecuteTemplateQueryController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Template/Query/ExecuteTemplateQueryController.cs @@ -43,41 +43,6 @@ public ExecuteTemplateQueryController( _publishedContentStatusFilteringService = publishedContentStatusFilteringService; } - [Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")] - public ExecuteTemplateQueryController( - IPublishedContentQuery publishedContentQuery, - IVariationContextAccessor variationContextAccessor, - IPublishedValueFallback publishedValueFallback, - IContentTypeService contentTypeService, - IPublishedContentCache contentCache, - IDocumentNavigationQueryService documentNavigationQueryService, - IPublishedContentStatusFilteringService publishedContentStatusFilteringService) - : this( - publishedContentQuery, - publishedValueFallback, - contentTypeService, - documentNavigationQueryService, - publishedContentStatusFilteringService) - { - } - - [Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")] - public ExecuteTemplateQueryController( - IPublishedContentQuery publishedContentQuery, - IVariationContextAccessor variationContextAccessor, - IPublishedValueFallback publishedValueFallback, - IContentTypeService contentTypeService, - IPublishedContentCache contentCache, - IDocumentNavigationQueryService documentNavigationQueryService) - : this( - publishedContentQuery, - publishedValueFallback, - contentTypeService, - documentNavigationQueryService, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - [HttpPost("execute")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(TemplateQueryResultResponseModel), StatusCodes.Status200OK)] From 5e51cecc5e724818e947a6d7ab35f9c0236e357f Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:15:30 +0200 Subject: [PATCH 11/18] Removing obsoleted code from MediaCollectionControllerBase.cs & Dependencies --- .../Media/Collection/MediaCollectionControllerBase.cs | 6 ------ .../ViewModels/Media/MediaResponseModel.cs | 3 --- 2 files changed, 9 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/Collection/MediaCollectionControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/Collection/MediaCollectionControllerBase.cs index 875c65c7ace7..23c1b7362a36 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/Collection/MediaCollectionControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Media/Collection/MediaCollectionControllerBase.cs @@ -26,12 +26,6 @@ protected MediaCollectionControllerBase(IUmbracoMapper mapper, SignProviderColle { } - [Obsolete("Please use the constructor with all parameters. Scheduled to be removed in Umbraco 18")] - protected MediaCollectionControllerBase(IUmbracoMapper mapper) - : base(mapper) - { - } - protected IActionResult CollectionOperationStatusResult(ContentCollectionOperationStatus status) => ContentCollectionOperationStatusResult(status, "media"); } diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Media/MediaResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Media/MediaResponseModel.cs index 522e1a1d0e7d..2667f5019956 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Media/MediaResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/Media/MediaResponseModel.cs @@ -5,9 +5,6 @@ namespace Umbraco.Cms.Api.Management.ViewModels.Media; public class MediaResponseModel : ContentResponseModelBase { - [Obsolete("This property is no longer populated. Please use /media/{id}/urls instead to retrieve the URLs for a document. Scheduled for removal in Umbraco 17.")] - public IEnumerable Urls { get; set; } = Enumerable.Empty(); - public bool IsTrashed { get; set; } public MediaTypeReferenceResponseModel MediaType { get; set; } = new(); From c6bebae3c6cc2bd215df510d154502d3f5ce2422 Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:15:43 +0200 Subject: [PATCH 12/18] Removing the class ReferencesDataTypeController.cs --- .../DataType/ReferencesDataTypeController.cs | 40 ------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/Umbraco.Cms.Api.Management/Controllers/DataType/ReferencesDataTypeController.cs diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/ReferencesDataTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/ReferencesDataTypeController.cs deleted file mode 100644 index 0eee28e49b80..000000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/ReferencesDataTypeController.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Asp.Versioning; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Management.ViewModels.DataType; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Core.Services.OperationStatus; - -namespace Umbraco.Cms.Api.Management.Controllers.DataType; - -[ApiVersion("1.0")] -[Obsolete("Please use ReferencedByDataTypeController and the referenced-by endpoint. Scheduled for removal in Umbraco 17.")] -public class ReferencesDataTypeController : DataTypeControllerBase -{ - private readonly IDataTypeService _dataTypeService; - private readonly IDataTypeReferencePresentationFactory _dataTypeReferencePresentationFactory; - - public ReferencesDataTypeController(IDataTypeService dataTypeService, IDataTypeReferencePresentationFactory dataTypeReferencePresentationFactory) - { - _dataTypeService = dataTypeService; - _dataTypeReferencePresentationFactory = dataTypeReferencePresentationFactory; - } - - [HttpGet("{id:guid}/references")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(DataTypeReferenceResponseModel[]), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - public async Task References(CancellationToken cancellationToken, Guid id) - { - Attempt>, DataTypeOperationStatus> result = await _dataTypeService.GetReferencesAsync(id); - if (result.Success == false) - { - return DataTypeOperationStatusResult(result.Status); - } - - DataTypeReferenceResponseModel[] viewModels = _dataTypeReferencePresentationFactory.CreateDataTypeReferenceViewModels(result.Result).ToArray(); - return Ok(viewModels); - } -} From 79ae1a0fe0f7b18ef6b7f6ba7a6e59898cbfdfa8 Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:15:54 +0200 Subject: [PATCH 13/18] Removing obsoleted code from RelationTypePresentationFactory.cs --- .../Factories/RelationTypePresentationFactory.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Factories/RelationTypePresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/RelationTypePresentationFactory.cs index 990312845c2d..34763e6ce50a 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/RelationTypePresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/RelationTypePresentationFactory.cs @@ -18,16 +18,6 @@ public class RelationTypePresentationFactory : IRelationTypePresentationFactory private readonly IDocumentPresentationFactory _documentPresentationFactory; private readonly IScopeProvider _scopeProvider; - [Obsolete("Please use the non obsoleted constructor. Scheduled for removal in v17")] - public RelationTypePresentationFactory(IUmbracoMapper umbracoMapper) - : this( - umbracoMapper, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - public RelationTypePresentationFactory( IUmbracoMapper umbracoMapper, IEntityRepository entityRepository, From 2e655ff4ec6fcca0c7365c853fca3dddf2f8f2cb Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:16:03 +0200 Subject: [PATCH 14/18] Removing obsoleted code from SearchDocumentTypeItemController.cs --- .../Item/SearchDocumentTypeItemController.cs | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Item/SearchDocumentTypeItemController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Item/SearchDocumentTypeItemController.cs index fd9a9217b0e7..d7428c865439 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Item/SearchDocumentTypeItemController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Item/SearchDocumentTypeItemController.cs @@ -16,23 +16,6 @@ public class SearchDocumentTypeItemController : DocumentTypeItemControllerBase private readonly IUmbracoMapper _mapper; private readonly IContentTypeSearchService _contentTypeSearchService; - [Obsolete("Please use ctor that only accepts IUmbracoMapper & IContentTypeSearchService, scheduled for removal in v17")] - public SearchDocumentTypeItemController(IEntitySearchService entitySearchService, IContentTypeService contentTypeService, IUmbracoMapper mapper) - : this(mapper, StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [Obsolete("Please use ctor that only accepts IUmbracoMapper & IContentTypeSearchService, scheduled for removal in v17")] - // We need to have this constructor, or else we get ambiguous constructor error - public SearchDocumentTypeItemController( - IEntitySearchService entitySearchService, - IContentTypeService contentTypeService, - IUmbracoMapper mapper, - IContentTypeSearchService contentTypeSearchService) - : this(mapper, contentTypeSearchService) - { - } - [ActivatorUtilitiesConstructor] public SearchDocumentTypeItemController(IUmbracoMapper mapper, IContentTypeSearchService contentTypeSearchService) { @@ -40,11 +23,6 @@ public SearchDocumentTypeItemController(IUmbracoMapper mapper, IContentTypeSearc _contentTypeSearchService = contentTypeSearchService; } - [NonAction] - [Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")] - public async Task Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100) - => await SearchDocumentType(cancellationToken, query, null, skip, take); - [HttpGet("search")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(PagedModel), StatusCodes.Status200OK)] From aa76b951637541aa878fb96b35ed544d74819b2e Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:16:16 +0200 Subject: [PATCH 15/18] Removing obsoleted code from UserPresentationFactory.cs & Dependencies --- .../Factories/UserPresentationFactory.cs | 72 ------------------- .../Entities/UserStartNodeEntitiesService.cs | 9 --- 2 files changed, 81 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Factories/UserPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/UserPresentationFactory.cs index 80c7b17e7862..bf5e085cfa51 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/UserPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/UserPresentationFactory.cs @@ -40,74 +40,6 @@ public class UserPresentationFactory : IUserPresentationFactory private readonly SecuritySettings _securitySettings; private readonly Dictionary _permissionPresentationMappersByType; - /// - /// Initializes a new instance of the class. - /// - [Obsolete("Please use the constructor taking all parameters. Scheduled for removal in Umbraco 17.")] - public UserPresentationFactory( - IEntityService entityService, - AppCaches appCaches, - MediaFileManager mediaFileManager, - IImageUrlGenerator imageUrlGenerator, - IUserGroupPresentationFactory userGroupPresentationFactory, - IAbsoluteUrlBuilder absoluteUrlBuilder, - IEmailSender emailSender, - IPasswordConfigurationPresentationFactory passwordConfigurationPresentationFactory, - IOptionsSnapshot securitySettings, - IBackOfficeExternalLoginProviders externalLoginProviders) - : this( - entityService, - appCaches, - mediaFileManager, - imageUrlGenerator, - userGroupPresentationFactory, - absoluteUrlBuilder, - emailSender, - passwordConfigurationPresentationFactory, - securitySettings, - externalLoginProviders, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - - /// - /// Initializes a new instance of the class. - /// - [Obsolete("Please use the constructor taking all parameters. Scheduled for removal in Umbraco 17.")] - public UserPresentationFactory( - IEntityService entityService, - AppCaches appCaches, - MediaFileManager mediaFileManager, - IImageUrlGenerator imageUrlGenerator, - IUserGroupPresentationFactory userGroupPresentationFactory, - IAbsoluteUrlBuilder absoluteUrlBuilder, - IEmailSender emailSender, - IPasswordConfigurationPresentationFactory passwordConfigurationPresentationFactory, - IOptionsSnapshot securitySettings, - IBackOfficeExternalLoginProviders externalLoginProviders, - IUserService userService, - IContentService contentService) - : this( - entityService, - appCaches, - mediaFileManager, - imageUrlGenerator, - userGroupPresentationFactory, - absoluteUrlBuilder, - emailSender, - passwordConfigurationPresentationFactory, - securitySettings, - externalLoginProviders, - userService, - contentService, - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - - // TODO (V17): Remove the unused userService and contentService parameters from this constructor. - /// /// Initializes a new instance of the class. /// @@ -122,10 +54,6 @@ public UserPresentationFactory( IPasswordConfigurationPresentationFactory passwordConfigurationPresentationFactory, IOptionsSnapshot securitySettings, IBackOfficeExternalLoginProviders externalLoginProviders, -#pragma warning disable IDE0060 // Remove unused parameter - need to keep these until the next major to avoid breaking changes and/or ambiguous constructor errors - IUserService userService, - IContentService contentService, -#pragma warning restore IDE0060 // Remove unused parameter IEnumerable permissionPresentationMappers) { _entityService = entityService; diff --git a/src/Umbraco.Cms.Api.Management/Services/Entities/UserStartNodeEntitiesService.cs b/src/Umbraco.Cms.Api.Management/Services/Entities/UserStartNodeEntitiesService.cs index 02adf136e5f5..6fda490b614e 100644 --- a/src/Umbraco.Cms.Api.Management/Services/Entities/UserStartNodeEntitiesService.cs +++ b/src/Umbraco.Cms.Api.Management/Services/Entities/UserStartNodeEntitiesService.cs @@ -17,15 +17,6 @@ public class UserStartNodeEntitiesService : IUserStartNodeEntitiesService private readonly ICoreScopeProvider _scopeProvider; private readonly IIdKeyMap _idKeyMap; - [Obsolete("Please use the non-obsolete constructor. Scheduled for removal in V17.")] - public UserStartNodeEntitiesService(IEntityService entityService) - : this( - entityService, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - public UserStartNodeEntitiesService(IEntityService entityService, ICoreScopeProvider scopeProvider, IIdKeyMap idKeyMap) { _entityService = entityService; From a3f2d41e0dabfb28786da6521b111abd7699ee53 Mon Sep 17 00:00:00 2001 From: NillasKA Date: Thu, 21 Aug 2025 14:16:26 +0200 Subject: [PATCH 16/18] Removing obsoleted code from ValidateCreateDocumentController.cs & Dependencies --- .../Document/ValidateCreateDocumentController.cs | 13 ------------- .../Document/ValidateUpdateDocumentController.cs | 13 ------------- 2 files changed, 26 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateCreateDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateCreateDocumentController.cs index 7087e119f776..6c2c22a9bdba 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateCreateDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateCreateDocumentController.cs @@ -21,19 +21,6 @@ public class ValidateCreateDocumentController : CreateDocumentControllerBase private readonly IContentEditingService _contentEditingService; private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; - [Obsolete("Please use the constructor taking all parameters. Scheduled for removal in Umbraco 17.")] - public ValidateCreateDocumentController( - IAuthorizationService authorizationService, - IDocumentEditingPresentationFactory documentEditingPresentationFactory, - IContentEditingService contentEditingService) - : this( - authorizationService, - documentEditingPresentationFactory, - contentEditingService, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - [ActivatorUtilitiesConstructor] public ValidateCreateDocumentController( IAuthorizationService authorizationService, diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs index bf06571c9450..474ccf945b6b 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs @@ -21,19 +21,6 @@ public class ValidateUpdateDocumentController : UpdateDocumentControllerBase private readonly IDocumentEditingPresentationFactory _documentEditingPresentationFactory; private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; - [Obsolete("Please use the constructor taking all parameters. Scheduled for removal in Umbraco 17.")] - public ValidateUpdateDocumentController( - IAuthorizationService authorizationService, - IContentEditingService contentEditingService, - IDocumentEditingPresentationFactory documentEditingPresentationFactory) - : this( - authorizationService, - contentEditingService, - documentEditingPresentationFactory, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - [ActivatorUtilitiesConstructor] public ValidateUpdateDocumentController( IAuthorizationService authorizationService, From 80f0117d64394d73d6fd104554ce3919d0f6d281 Mon Sep 17 00:00:00 2001 From: NillasKA Date: Fri, 22 Aug 2025 12:13:35 +0200 Subject: [PATCH 17/18] Removing unused imports and redundant attribute --- src/Umbraco.Cms.Api.Delivery/Querying/QueryOptionBase.cs | 3 --- .../Controllers/Document/ByKeyDocumentController.cs | 4 ---- 2 files changed, 7 deletions(-) diff --git a/src/Umbraco.Cms.Api.Delivery/Querying/QueryOptionBase.cs b/src/Umbraco.Cms.Api.Delivery/Querying/QueryOptionBase.cs index 761abe36b6f7..8af09fce6cc9 100644 --- a/src/Umbraco.Cms.Api.Delivery/Querying/QueryOptionBase.cs +++ b/src/Umbraco.Cms.Api.Delivery/Querying/QueryOptionBase.cs @@ -1,8 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.DeliveryApi; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models.PublishedContent; -using Umbraco.Cms.Core.PublishedCache; using Umbraco.Extensions; namespace Umbraco.Cms.Api.Delivery.Querying; diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs index 3bd5a26f51f6..f61fa1540883 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs @@ -2,13 +2,10 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Api.Management.Factories; using Umbraco.Cms.Api.Management.ViewModels.Document; using Umbraco.Cms.Core.Actions; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Security.Authorization; -using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Services.Querying; using Umbraco.Cms.Web.Common.Authorization; using Umbraco.Extensions; @@ -22,7 +19,6 @@ public class ByKeyDocumentController : DocumentControllerBase private readonly IDocumentPresentationFactory _documentPresentationFactory; private readonly IContentQueryService _contentQueryService; - [ActivatorUtilitiesConstructor] public ByKeyDocumentController( IAuthorizationService authorizationService, IDocumentPresentationFactory documentPresentationFactory, From 06f320d5a78ed6decb1c1dfc82ddce05b99e46f2 Mon Sep 17 00:00:00 2001 From: NillasKA Date: Fri, 22 Aug 2025 13:37:51 +0200 Subject: [PATCH 18/18] Removing unused constructor attribute --- .../Controllers/Document/ValidateCreateDocumentController.cs | 1 - .../Controllers/Document/ValidateUpdateDocumentController.cs | 1 - .../DocumentType/Item/SearchDocumentTypeItemController.cs | 1 - 3 files changed, 3 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateCreateDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateCreateDocumentController.cs index 6c2c22a9bdba..2ba44b38ab77 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateCreateDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateCreateDocumentController.cs @@ -21,7 +21,6 @@ public class ValidateCreateDocumentController : CreateDocumentControllerBase private readonly IContentEditingService _contentEditingService; private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; - [ActivatorUtilitiesConstructor] public ValidateCreateDocumentController( IAuthorizationService authorizationService, IDocumentEditingPresentationFactory documentEditingPresentationFactory, diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs index 474ccf945b6b..e5470de907d5 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs @@ -21,7 +21,6 @@ public class ValidateUpdateDocumentController : UpdateDocumentControllerBase private readonly IDocumentEditingPresentationFactory _documentEditingPresentationFactory; private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; - [ActivatorUtilitiesConstructor] public ValidateUpdateDocumentController( IAuthorizationService authorizationService, IContentEditingService contentEditingService, diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Item/SearchDocumentTypeItemController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Item/SearchDocumentTypeItemController.cs index d7428c865439..5e9ceb568a70 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Item/SearchDocumentTypeItemController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Item/SearchDocumentTypeItemController.cs @@ -16,7 +16,6 @@ public class SearchDocumentTypeItemController : DocumentTypeItemControllerBase private readonly IUmbracoMapper _mapper; private readonly IContentTypeSearchService _contentTypeSearchService; - [ActivatorUtilitiesConstructor] public SearchDocumentTypeItemController(IUmbracoMapper mapper, IContentTypeSearchService contentTypeSearchService) { _mapper = mapper;