Cleaned up constructors, regions and variables in NewDefaultUrlProvider#19403
Merged
Cleaned up constructors, regions and variables in NewDefaultUrlProvider#19403
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the NewDefaultUrlProvider by introducing a new constructor that takes ILanguageService, removing obsolete regions and fields, and resolving compiler warnings.
- Added a primary constructor accepting
ILanguageServiceand marked legacy constructors as obsolete for removal in v17 - Removed unused
_localizationServicefield, cleaned up region directives, and simplified string slicing - Replaced synchronous
ILocalizationServicecalls, updated explicit type annotations, and streamlined logging checks
Comments suppressed due to low confidence (1)
src/Umbraco.Core/Routing/NewDefaultUrlProvider.cs:83
- The logger is declared as
ILogger<DefaultUrlProvider>insideNewDefaultUrlProvider. Consider usingILogger<NewDefaultUrlProvider>to ensure logged messages use the correct category name.
ILogger<DefaultUrlProvider> logger,
kjac
approved these changes
May 26, 2025
Contributor
kjac
left a comment
There was a problem hiding this comment.
Looks good and tests out good too 👍
AndyButland
added a commit
that referenced
this pull request
May 26, 2025
…er (#19403) Cleaned up constructors, regions and variables in NewDefaultUrlProvider.
This was referenced Jul 28, 2025
This was referenced Aug 26, 2025
This was referenced Sep 8, 2025
This was referenced Oct 20, 2025
This was referenced Oct 20, 2025
This was referenced Oct 27, 2025
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.
Prerequisites
Resolves: #19402 (although the complete resolution won't come until 17, we can close this after this PR is merged as there are no further immediate actions and those needed later are indicated in the obsoletion messages).
Description
This PR is just some minor refactoring and preparation for Umbraco 17 when we can finally remove the obsolete parameters in the constructor for this class. I added a new constructor using the replacement for the obsolete
ILocalizationService, removed the unnecessary regions and resolved the remaining warnings in the class.Testing
Should be clear from visual inspection there's no concern with the changes, but I have verified that URLs continue to be generated having booted up Umbraco.