Management API: Fix document URLs returning all languages for invariant content (closes #21459)#21473
Merged
AndyButland merged 1 commit intomainfrom Jan 22, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a regression in the Management API's /umbraco/management/api/v1/document/urls endpoint where invariant content incorrectly returned URL records for all configured languages instead of just the default language. The fix adds a culture variation check before determining which languages to process.
Changes:
- Modified
PublishedUrlInfoProvider.GetAllAsyncto check if content varies by culture before determining which languages to iterate - Added integration test to verify invariant content only returns the default language URL
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Umbraco.Core/Routing/PublishedUrlInfoProvider.cs | Added conditional logic to iterate only through the default language for invariant content, preserving all-language iteration for variant content |
| tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProviderTests.cs | Added test case to verify invariant content returns only one URL for the default language when multiple languages are configured |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses the issue raised in #21459 where URLs for invariant content show for all languages in the "Info" workspace view.
Change Summary
/umbraco/management/api/v1/document/urlsendpoint returning URL records for all configured languages even for invariant documents.Root Cause
It looks like this issue was introduced in PR #18072 "V15: Fix Url Preview" on January 29, 2025.
The
PublishedUrlInfoProvider.GetAllAsyncmethod was changed to iterate through all configured languages without checking if the content is variant or invariant. The previous implementation (IDocumentUrlService.ListUrlsAsync) had filtering logic that would skip non-default languages for content without assigned domains:This filtering was lost when switching to the new
IPublishedUrlInfoProvider.GetAllAsyncimplementation.Fix
I haven't looked to revert any logic from that PR as it was doing more than handle the functionality related to this issue. Rather I think we can just check if the document is invariant, and if so, only consider the default language.
So fhe fix checks if the content type varies by culture before determining which languages to iterate:
Testing
I've added integration test
Invariant_content_returns_only_default_language_urlthat verifies invariant content only returns one URL for the default language.And in testing I see for invariant now only the default language and a single URL, and for variant the appropriate URL for the selected language.