V17 - Removed obsoleted code from Umbraco.Cms.Core.Cache & .Routing (#19959)

* Removing obsoleted code from ApiMediaQueryService.cs

* Removing obsoleted code from ApiRichTextMarkupParserTests.cs

* Removing obsoleted code from ContentCacheRefresher.cs

* Removing obsoleted code from ContentFinderByUrlAlias.cs and adjusting its tests to use the new logic

* Removing obsoleted code from ContentFinderByUrl.cs & its dependencies

* Removing obsoleted code from ApiRichTextMarkupParserTests.cs

* Removing obsoleted code from DocumentCache.cs & its dependencies

* Removing obsoleted code from MediaCache.cs & its dependencies

* Removing obsoleted code from PublishedCacheBase.cs & its dependencies

* Removing obsoleted code from RenderNoContentController.cs and its tests

* Removing obsoleted code from UmbracoRouteValueTransformer.cs

* Removing obsoleted constructors from DefaultUrlProvider.cs

* Removing accidental bookmark

* Introducing a helper method to get the root keys in ApiMediaQueryService.cs

* Removing obsoleted code from Cache classes

* Removing unused imports

* Refactoring to meet the CR

* Added attribute to controller

* Fixing missing using statement
This commit is contained in:
Nicklas Kramer
2025-08-27 11:02:21 +02:00
committed by GitHub
parent b8ca11edd6
commit 20c29f8091
4 changed files with 15 additions and 18 deletions

View File

@@ -1,4 +1,3 @@
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Core.Routing;
@@ -45,7 +44,10 @@ public sealed class DocumentCache : IPublishedContentCache
public IEnumerable<IPublishedContent> GetAtRoot(bool preview, string? culture = null)
{
_documentNavigationQueryService.TryGetRootKeys(out IEnumerable<Guid> rootKeys);
if (_documentNavigationQueryService.TryGetRootKeys(out IEnumerable<Guid> rootKeys) is false)
{
return [];
}
IEnumerable<IPublishedContent> rootContent = rootKeys.Select(key => GetById(preview, key)).WhereNotNull();
return culture is null ? rootContent : rootContent.Where(x => x.IsInvariantOrHasCulture(culture));

View File

@@ -1,4 +1,3 @@
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Core.Services.Navigation;
@@ -35,7 +34,10 @@ public sealed class MediaCache : IPublishedMediaCache
public IEnumerable<IPublishedContent> GetAtRoot(bool preview, string? culture = null)
{
_mediaNavigationQueryService.TryGetRootKeys(out IEnumerable<Guid> rootKeys);
if (_mediaNavigationQueryService.TryGetRootKeys(out IEnumerable<Guid> rootKeys) is false)
{
return [];
}
IEnumerable<IPublishedContent> rootContent = rootKeys.Select(key => GetById(preview, key)).WhereNotNull();
return culture is null ? rootContent : rootContent.Where(x => x.IsInvariantOrHasCulture(culture));