Skip to content

Multilanguage AUM pass incorrect urlParms to TransformFriendlyUrlToQueryString #2335

@Mohtshum

Description

@Mohtshum

Description of bug

By default, running advanced URL format, the resulting URL looks like this:

http://site.com/pagename/param1

The TransformFriendlyUrlToQueryString method that needs to be implemented by providers will see the correct urlParms parameter containing 1 array entry:
urlParms

{string[1]}

string[]
[0] "param1" string

As soon as you enable multiple languages on a site under Admin > Languages, it automatically creates site aliases with entries like site.com/en-us and site.com/en-ca

http://site.com/en-us/pagename/param1
http://site.com/en-ca/pagename/param1

Notice the urlParms parameter is incorrectly populated breaking the parser in the URL extension provider. The URL extension provider is unable to correctly guess and separate between what is actual query parameter and page:

urlParms

{string[3]}

string[]
[0] "en-us" string
[1] "pagename" string
[2] "param1" string

To confirm the inconsistency, the article here http://www.dnnsoftware.com/wiki/extension-url-providers states the urlParms parameter should exclude the page path (and therefore language too).

urlParms : a string array of the URL segments (/segment1/segment2) in the URL "after" the site alias & page path have been matched and removed from the entire URL. In this example, it would be an array of 1 position with 'My-Item' in it.

Please fix this ASAP as it breaks the advanced URL provider badly.

Steps to reproduce

  1. Create a new ExtensionUrlProvider, in that case TransformFriendlyUrlToQueryString needs to be implemented by provider.
  2. In normal situation when multi-languages are not enabled, parameters passed to this function will be correct, i.e. page name and all other prior segments wont be part of parameter list.assuming url was http://site.com/pagename/param1 page name wont be in param list
  3. now if we enable multi-languages params passed to above function now contain lang identifier as well page name
  4. Expected behavior should be even after enabling multi-languages, params passed to 

Current result

Custom logic based on params is breaking due to additional language params are passing into the application

Expected result

urlParms should not contain any language code

Affected version

  • 9.2.2
  • 9.2.1
  • 9.2
  • 9.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions