episerver / netcore-preview

This repository is a preview providing early access to the latest Optimizely (formerly Episerver) product packages targeting .NET 5.
43 stars 9 forks source link

Adding query string parameters to UrlResolverArguments.RouteValues has no effect #94

Closed stefanolsen closed 3 years ago

stefanolsen commented 3 years ago

Observations: When resolving a URL to a content item, and adding custom query string parameters (as route values) to UrlResolverArguments.RouteValues, the URL is the same as if it was not passed.

Expected: The resolved URL should end with query string parameters, reflecting the passed route values.

Builds:

bjuris commented 3 years ago

Maybe @jbearfoot can comment on this. It sounds like a behaviour of the old ASP.NET routing system that is no longer being used.

stefanolsen commented 3 years ago

It looks like it works when calling GetUrl(UrlBuilder urlBuilderWithInternalUrl, UrlResolverArguments arguments), but not GetUrl(ContentReference contentLink, string language, UrlResolverArguments arguments).

Checked the code. The first overload has query string handling, while the second does not.

I would prefer that these two overloads behaves in the same way.

stefanolsen commented 3 years ago

@jbearfoot: Can you check whether the above is easy to fix?

jbearfoot commented 3 years ago

There is currently a PR up that includes a fix for this. So it will be fixed but not sure when there will be a package available that includes the fix

stefanolsen commented 3 years ago

@jbearfoot: Very nice. Will you be writing release notes for future releases, so we can see which issues to re-test after a release?

jbearfoot commented 3 years ago

It will be part of EPiServer.CMS.Core 12.0.2 package