Routing: Fix URL aliases not stored for variant content with shared alias property in DocumentUrlAliasService#21571
Merged
AndyButland merged 2 commits intorelease/17.2from Feb 4, 2026
Conversation
… were not being recorded.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes URL aliases not being stored for culture-variant content types when the umbracoUrlAlias property itself is shared (invariant), by checking property-level variation rather than only content-type variation.
Changes:
- Update
DocumentUrlAliasService.ExtractAliasesFromDocumentAsyncto readumbracoUrlAliaswithout culture when the property does not vary by culture (even if the content type does). - Add integration tests covering both variant-alias and shared-alias scenarios on culture-variant content types.
- Update tests to use
ITemplateService.CreateAsyncinstead of the obsoleteIFileService.SaveTemplate.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/Umbraco.Core/Services/DocumentUrlAliasService.cs |
Determines alias culture-variance from the umbracoUrlAlias property type and stores aliases accordingly. |
tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentUrlAliasServiceTests.cs |
Adds integration test coverage for variant content types with shared vs culture-varied alias properties; updates template creation to ITemplateService. |
tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentUrlAliasServiceTests.cs
Outdated
Show resolved
Hide resolved
tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentUrlAliasServiceTests.cs
Outdated
Show resolved
Hide resolved
AndyButland
commented
Jan 29, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
DocumentUrlAliasService
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 fixes a bug found in testing of the document URL alias service, introduced as an optimisation for finding documents by URL alias in #21396.
I found URL aliases were not being stored for variant content types that have a shared (non-culture-varied)
umbracoUrlAliasproperty.The service now checks if the alias property itself varies by culture, not just the content type, which fixes this issue.
Root Cause
ExtractAliasesFromDocumentAsynconly checked if the content type varies by culture. For variant content types, it always calleddocument.GetValue<string>(alias, culture)with a culture parameter. However, for shared properties, this returnsnullbecause shared properties don't have culture-specific values.Fix
Check if the
umbracoUrlAliasproperty itself varies by culture:Testing
For manual verification, create a variant document type with a shared, text string property with an alias of
umbracoUrlAlias.Create a document of that type, populate the property and verify it has been recorded in
umbracoDocumentUrlAlias.An integration test has been added that verifies this behaviour.