Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Open Core Testi...Open Core Testi...DNN 5.5 Language Switching - invalid Friendly Url Parameter combinationDNN 5.5 Language Switching - invalid Friendly Url Parameter combination
Previous
 
Next
New Post
7/20/2010 1:01 AM
 
While scratching my head about why some Urls were coming out a bit weird when on a page with a translated version, I found out that there is some invalid parameter combinations being passed into the Friendly Url Provider API.

The above screenshot shows the parameters passed into the Friendly Url Provider via the DotNetNuke.Common.Globals.NavigateUrl (tab, path, pageName, portalSettings ) method overload. This particular call is for a Netherlands language translation of the current page, and is the linked Url for the nl-NL flag on the page.

In this example, this was the values provided: tab : tab object for TabId 61, tabPath of //TestPage path : ~/Default.aspx?tabid=63&language=nl-NL - the raw Url for the translated page, which is Tabid 63 page : /default.aspx (normal) portalSettings : current portal settings. You can see the current portal settings are for culture code en-US The problem is that the path (?tabid=63&language=nl-NL) don't match the supplied Tab object (tabid 61, culture= en-US). I think it shouldn't be valid to provide a path for one tab, and then provide the tab object for another.

I belive the problem lies in the TabController.GetTab(tabid,portalid, ignoreCache) call, which underlies the LanguageTokenReplace(newLanguage) call, via the NavigateUrl call.  The problem is in this line (TabController.GetTab, line 703)

' if we have the PortalId then try to get the TabInfo object
                If PortalController.GetPortalSettingAsBoolean("ContentLocalizationEnabled", PortalId, False) Then
                    tab = GetTabByCulture(TabId, PortalId, LocaleController.Instance().GetCurrentLocale(PortalId))
                Else
                    tab = GetTabsByPortal(PortalId).WithTabId(TabId)
                End If

Because the 'contentLocalizationEnabled' value returns True, then the tab is retrieved by the tabid, portalId and culture.  However, because the current locale returned by 'GetCurrentLocale' is en-US, then the wrong tab is returned, which ends up in a mismatched tab object and path being sent to the Friendly Url Provider.

The fix is either to change the NavigateUrl call to find the Tabid based on the Language parameter using GetTabByCulture when Language is supplied, or to
create a new overload for GetTab where the language can be supplied when checking for a contentLocalizationEnabled setting.  For the purposes of language switching, you shouldn't rely on the current configured locale, because you want to find the Url for a different locale to the one you're currently in.

Let me know if this needs to be put in Gemini, or if anyone has any other thoughts.  I don't think 5.5 should be released like this, because it will start to create legacy Urls for future upgrades that will be hard to fix up.

 
New Post
7/20/2010 5:22 AM
 
Bruce, AFAIK it has already been reported that there are issues with language param in the URL and suggest waiting for next beta package.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
7/20/2010 6:10 AM
 
yes, this is a slightly different problem - because it affects the language switching, not necessarily language parameters in the Url.  What you end up with is the wrong Url for the translated language page.

I will wait for the next Beta and see what happens.
 
New Post
7/20/2010 6:14 AM
 
As far as I understood page localization in DNN 5.5, it uses different tab records per language in teh database, but always master language tabID in UI, i.e. same tabId, when switching between languages. I don't know yet, whether this will will be kept.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
7/20/2010 9:07 AM
 
From my testing the tabid always changes.  Each translated tab has a master (original language) and associated translated versions.  When you switch from each tab (master->translated1, translated2) the Url changes to match the tabId of each of the translated.  Note it has to be this way because there is no special handling in the Url Rewriter to determine which language a tab belongs to.

In my example 61 is the en-US and 63 is the nl-NL.  The problem is that the path is for 63 but the Tab object is for 61, because the tabobject is retrieved by TabId, portalId and language, and the language is en-US.   WHen you ask for tabid 63, portal id 0 and language nl-NL you actually get back tab 61.

What happens because of this is that the Url drops the tabname part of it : so tabname/tabid/61/language/en-US/defualt.aspx becomes tabid/63/language/nl-NL/default.aspx - this is because of the tabid in the path not matching the tab object.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Open Core Testi...Open Core Testi...DNN 5.5 Language Switching - invalid Friendly Url Parameter combinationDNN 5.5 Language Switching - invalid Friendly Url Parameter combination


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out