diff --git a/src/Umbraco.Core/Routing/NewDefaultUrlProvider.cs b/src/Umbraco.Core/Routing/NewDefaultUrlProvider.cs index bbc0f4011b..7f66f21933 100644 --- a/src/Umbraco.Core/Routing/NewDefaultUrlProvider.cs +++ b/src/Umbraco.Core/Routing/NewDefaultUrlProvider.cs @@ -89,8 +89,6 @@ public class NewDefaultUrlProvider : IUrlProvider yield break; } - - // look for domains, walking up the tree IPublishedContent? n = node; IEnumerable? domainUris = diff --git a/src/Umbraco.Core/Routing/PublishedUrlInfoProvider.cs b/src/Umbraco.Core/Routing/PublishedUrlInfoProvider.cs index d4059bcab8..c861d9ba01 100644 --- a/src/Umbraco.Core/Routing/PublishedUrlInfoProvider.cs +++ b/src/Umbraco.Core/Routing/PublishedUrlInfoProvider.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.Services; @@ -68,6 +68,12 @@ public class PublishedUrlInfoProvider : IPublishedUrlInfoProvider urlInfos.Add(UrlInfo.Url(url, culture)); } + // If the content is trashed, we can't get the other URLs, as we have no parent structure to navigate through. + if (content.Trashed) + { + return urlInfos; + } + // Then get "other" urls - I.E. Not what you'd get with GetUrl(), this includes all the urls registered using domains. // for these 'other' URLs, we don't check whether they are routable, collide, anything - we just report them. foreach (UrlInfo otherUrl in _publishedUrlProvider.GetOtherUrls(content.Id).OrderBy(x => x.Text).ThenBy(x => x.Culture))