Skip to content

NewDefaultUrlProvider using obsolete ILocalizationService #19402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ane-dwarf opened this issue May 23, 2025 · 2 comments · May be fixed by #19403
Open

NewDefaultUrlProvider using obsolete ILocalizationService #19402

ane-dwarf opened this issue May 23, 2025 · 2 comments · May be fixed by #19403
Labels

Comments

@ane-dwarf
Copy link

ane-dwarf commented May 23, 2025

Which Umbraco version are you using?

15.4.0

Bug summary

In previous versions (before v14) we were using DefaultUrlProvider as base for customizing URL's but as we started upgrading we saw that it's now the NewDefaultUrlProvider that is in the UrlProviderCollection. So far so good.

One weird thing is that it has two constructors: one marked as obsolete and one not. Bot using ILocalizationService which is marked as obsolete and set for removal in v15.

And since I'm currently on v15.4.0 I'm basically just wondering what is going on? 😆

Specifics

No response

Steps to reproduce

public NewCustomUrlProvider(IOptionsMonitor<RequestHandlerSettings> requestSettings,
    ILogger<DefaultUrlProvider> logger,
    ISiteDomainMapper siteDomainMapper,
    IUmbracoContextAccessor umbracoContextAccessor,
    UriUtility uriUtility,
    ILocalizationService localizationService, //[Obsolete("Please use ILanguageService and IDictionaryItemService for localization. Will be removed in V15.")]
    IPublishedContentCache publishedContentCache,
    IDomainCache domainCache,
    IIdKeyMap idKeyMap,
    IDocumentUrlService documentUrlService,
    IDocumentNavigationQueryService documentNavigationQueryService,
    IPublishedContentStatusFilteringService publishedContentStatusFilteringService) : base(requestSettings, logger, siteDomainMapper, umbracoContextAccessor, uriUtility, localizationService, publishedContentCache, domainCache, idKeyMap, documentUrlService, documentNavigationQueryService, publishedContentStatusFilteringService)
{
}

Expected result / actual result

I would expect a constructor that accepts ILanguageService instead as its only purpose in NewDefaultUrlProvider is this:

var defaultCulture = _localizationService.GetDefaultLanguageIsoCode();

Copy link

Hi there @ane-dwarf!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@AndyButland
Copy link
Contributor

We've recognised that although ILocalizationService is deprecated, we do have some areas where we need to continue to use it - see for example the discussion here.

As such it won't be removed until there's time for more significant refactoring.

As with all public code constructs, we won't remove or amend them in a breaking way within a major version, so if it's there in 15, you can be confident it won't be amended until the next major (and as I can see it's in 16 too, it will remain for the lifetime of at least that version too).

That said, there is some clean-up we could do now in preparation in the class, so I'll do that shortly and link a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants