-
-
Notifications
You must be signed in to change notification settings - Fork 773
[Bug]: Error loading theme list when Portal has custom Portal HomeFolder #6263
Copy link
Copy link
Closed
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
When the Site directory is a custom directory Sites/MySite (not the default directory Portals/[portalid] )
When working with Themes, an error occurs at the CreateThumbnail constructor in ThemesController
Dnn.Platform/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Themes/ThemesController.cs
Lines 374 to 379 in f5374f3
| if (string.IsNullOrEmpty(imageFileName) || imageFileName.StartsWith("thumbnail_")) | |
| { | |
| strImage = Globals.ApplicationPath + "/" + strImage.Substring(strImage.IndexOf("portals\\")); | |
| strImage = strImage.Replace("\\", "/"); | |
| return strImage; | |
| } |
The current code
strImage.Substring(strImage.IndexOf("portals\\") causes an error because "portals\\" does not exist in the pathFix:
Replace the line
strThumbnail = Globals.ApplicationPath + "/" + strThumbnail.Substring(strThumbnail.IndexOf("portals\\"));with the line:
strImage = strImage.Substring(Globals.ApplicationMapPath.Length);Dnn.Platform/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Themes/ThemesController.cs
Line 442 in f5374f3
| strThumbnail = Globals.ApplicationPath + "/" + strThumbnail.Substring(strThumbnail.IndexOf("portals\\")); |
Fix:
Replace the line
strThumbnail = Globals.ApplicationPath + "/" + strThumbnail.Substring(strThumbnail.IndexOf("portals\\")); by the line
strThumbnail = strThumbnail.Substring(Globals.ApplicationMapPath.Length);
Steps to reproduce?
- Create a new Site, in the Site Directory section, enter a custom folder name, for example "
Sites/MYSITE"

By default, the Site folder will bePortals/[PortalID], but I have a habit of changing this folder - Copy any Theme set to the "
Sites/MYSITE-System/Skins" folder - Go to PersonalBar -> Themes and you will get an error
Go to settings for any page and you will also get an error
Current Behavior
No response
Expected Behavior
No response
Relevant log output
No response
Anything else?
No response
Affected Versions
9.13.6 (latest release)
What browsers are you seeing the problem on?
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable