Trees: Restore backward compatibility for file system based tree controllers (closes #20602) (#20608)

* Restore backward compatibility for file system based tree controllers.

* Aligned obsoletion messages.
This commit is contained in:
Andy Butland
2025-10-22 16:20:20 +02:00
committed by GitHub
parent f88e28d642
commit 6bc498ad41
16 changed files with 251 additions and 236 deletions

View File

@@ -1,34 +1,33 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.Services.FileSystem;
using Umbraco.Cms.Api.Management.ViewModels.Tree;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.IO;
namespace Umbraco.Cms.Api.Management.Controllers.PartialView.Tree;
[ApiVersion("1.0")]
public class RootPartialViewTreeController : PartialViewTreeControllerBase
{
private readonly IPartialViewTreeService _partialViewTreeService;
// TODO Remove the static service provider, and replace with base when the other constructors are obsoleted.
public RootPartialViewTreeController(IPartialViewTreeService partialViewTreeService)
: this(partialViewTreeService, StaticServiceProvider.Instance.GetRequiredService<FileSystems>())
=> _partialViewTreeService = partialViewTreeService;
[ActivatorUtilitiesConstructor]
[Obsolete("Please use the other constructor. Scheduled to be removed in Umbraco 19")]
public RootPartialViewTreeController(IPartialViewTreeService partialViewTreeService, FileSystems fileSystems)
: base(partialViewTreeService, fileSystems) =>
_partialViewTreeService = partialViewTreeService;
public RootPartialViewTreeController(IPartialViewTreeService partialViewTreeService)
: base(partialViewTreeService)
{
}
[Obsolete("Please use the other constructor. Scheduled to be removed in Umbraco 19")]
[Obsolete("Please use the constructor taking all parameters. Scheduled to be removed in Umbraco 19.")]
public RootPartialViewTreeController(IPartialViewTreeService partialViewTreeService, FileSystems fileSystems)
: base(partialViewTreeService, fileSystems)
{
}
[Obsolete("Please use the constructor taking all parameters. Scheduled to be removed in Umbraco 19.")]
public RootPartialViewTreeController(FileSystems fileSystems)
: this(StaticServiceProvider.Instance.GetRequiredService<IPartialViewTreeService>(), fileSystems)
: base(fileSystems)
{
}