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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Site Settings Labels Missing When Installed to Virtual DirectorySite Settings Labels Missing When Installed to Virtual Directory
Previous
 
Next
New Post
11/16/2009 3:17 PM
 

I can't believe this...if the name of the virtual directory you installed DNN into is called "portal", that's what causes this problem.  My theory: Somewhere in the localization process, it sees /portal and you're trying to get localized strings for a DesktopModule from the Portals folder, and it's doing some string substitution.  I traced through the code for quite a while and didn't find the exact line of code - but it explains the behavior perfectly.

See another post of this happening: www.dotnetnuke.com/Community/Forums/tabid/795/forumid/108/threadid/330562/scope/posts/Default.aspx

If you install to a different folder (not named "portal", it works.) This is a temporary workaround: (from that post):

DNN is looking at the wrong path for the resource file.

The location of the Resource File is:
[site root]\DesktopModules\Admin\Portals\App_LocalResources\SiteSettings.ascx.resx

The location where DNN is looking for the file:
[site root]\desktopmodules\admins\app_localresources\sitesettings.ascx.resx

Create these folders and put a copy of sitesettings.ascx.resx to this path. Then it works.

It seems to be replacing Admin\Portal with admin.

I'm not familiar enough with the code to know exactly where it's coming from. This behavior is specific to the modules located in the Portals folder.  I noticed this on SiteSettings and PortalAliases.  Well, I played hunch and renamed my virtual folder dnn.  No more issues.  I am avoiding the name "portal" for now, no wonder I had such consistent problems.

So, these are my findings.

Best Regards,

Ryan

 
New Post
11/16/2009 4:02 PM
Accepted Answer 

I found the line of code, it was in the Localization.vb class:

Private Shared Function TryGetFromResourceFile(ByVal key As String, ByVal resourceFile As String, ByVal portalID As Integer, ByVal resourceType As CustomizedLocale, ByRef resourceValue As String) As Boolean Dim dicResources As Dictionary(Of String, String) = Nothing Dim bFound As Boolean = Null.NullBoolean Dim resourceFileName As String = resourceFile Select Case resourceType Case CustomizedLocale.Host
                    resourceFileName = resourceFile.Replace(".resx", ".Host.resx")
                Case CustomizedLocale.Portal
                    resourceFileName = resourceFile.Replace(".resx", ".Portal-" + portalID.ToString + ".resx")
            End Select

            If resourceFileName.ToLowerInvariant().StartsWith("desktopmodules") OrElse resourceFileName.ToLowerInvariant().StartsWith("admin") Then
                resourceFileName = "~/" + resourceFileName
            End If

            'Local resource files are either named ~/... or <ApplicationPath>/...
            'The following logic creates a cachekey of /....
            Dim cacheKey As String = resourceFileName.Replace("~/", "/").ToLowerInvariant()
            If Not String.IsNullOrEmpty(ApplicationPath) Then
                If ApplicationPath.ToLowerInvariant <> "/portals" Then
                    'If the ApplicationPath is /portal, this next line of code will
                    'mess up the resx path to DesktopModules\Portals modules.
                    'Actually, it could clobber any DesktopModule names!
                    cacheKey = cacheKey.Replace(ApplicationPath.ToLowerInvariant(), "")
  
              Else
                    cacheKey = "~" & cacheKey
                    cacheKey = cacheKey.Replace("~" & ApplicationPath.ToLowerInvariant(), "")
                End If
            End If

            'Get resource file lookup to determine if the resource file even exists
            Dim resourceFileExistsLookup As Dictionary(Of String, Boolean) = GetResourceFileLookupDictionary()

            If (Not resourceFileExistsLookup.ContainsKey(cacheKey)) OrElse resourceFileExistsLookup(cacheKey) Then
                'File is not in lookup or its value is true so we know it exists
                dicResources = GetResourceFile(cacheKey)

                If dicResources IsNot Nothing Then
                    bFound = dicResources.TryGetValue(key, resourceValue)
                End If
            End If

            Return bFound
        End Function

It's replacing ALL found occurences within the string, not just the appPath as intended.

 
New Post
11/16/2009 4:13 PM
 

There is an open ticket on this: support.dotnetnuke.com/issue/ViewIssue.aspx

 
New Post
11/27/2009 6:00 PM
 

This issue was not addressed in the 5.2 release, so I've submitted a patch for it.  I'll also post it here in case anyone else is interested:

 This replaces the entire section of code in Localization.vb around line 592.

'Problem:  If AppPath is /portal, there is a desktop module called portals, the path is corrupted
'Before: /portal/desktopmodules/admin/portals/app_localresources/sitesettings.ascx.resx
'After : /desktopmodules/admins/app_localresources/sitesettings.ascx.resx
'Revised Code: Replace AppPath only.
Dim cacheKey As String = resourceFileName.Replace("~/", "/").ToLowerInvariant()
With ApplicationPath 'When running DNN in web root, AppPath is zero-length string.
  If Not String.IsNullOrEmpty(.ToLowerInvariant) Then
    If .ToLowerInvariant <> "/portals" Then
      If cacheKey.IndexOf(.ToLowerInvariant) <> -1 Then
        cacheKey = cacheKey.Remove(cacheKey.IndexOf(.ToLowerInvariant), .ToLowerInvariant.Length)
      End If
    Else
        cacheKey = "~" & cacheKey
        cacheKey = cacheKey.Replace("~" & .ToLowerInvariant, "")
    End If
  End If
End With
 
New Post
11/28/2009 4:23 AM
 

Thank you ryan, we will try to get it fixed in DNN 5.2.1 (or 5.2.2, depending on priorities).


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Site Settings Labels Missing When Installed to Virtual DirectorySite Settings Labels Missing When Installed to Virtual Directory


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