On retrieving other URLs, don't attempt to walk up the navigation structure to find parents when content is trashed. (#18355)
This commit is contained in:
@@ -89,8 +89,6 @@ public class NewDefaultUrlProvider : IUrlProvider
|
||||
yield break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// look for domains, walking up the tree
|
||||
IPublishedContent? n = node;
|
||||
IEnumerable<DomainAndUri>? domainUris =
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user