-
-
Notifications
You must be signed in to change notification settings - Fork 778
Add back RTL resource handling #6888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
valadas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
ProblemThe current RTL resource detection logic incorrectly combines a virtual path Example values: resource.FilePath = "~/Resources/Shared/stylesheets/dnndefault/10.0.0/default.css";
this.appStatus.ApplicationMapPath = "C:\\DnnTest\\dnn-10.2.1-v1";This produces an invalid physical path: As a result, File.Exists(...) always returns false, even when the RTL file var ext = Path.GetExtension(resource.FilePath);
var rtlFilePath = Path.ChangeExtension(resource.FilePath, ".rtl" + ext);
if (!File.Exists(this.appStatus.ApplicationMapPath + rtlFilePath))
{
return resource;
}Issue: Proposed Fix The fix uses resource.ResolvedPath to correctly check the physical existence var ext = Path.GetExtension(resource.FilePath);
// resource.FilePath is a virtual path (~),
// so we must use ResolvedPath to check physical file existence
var rtlResolvedPath = Path.ChangeExtension(resource.ResolvedPath, ".rtl" + ext);
var relativePath = rtlResolvedPath
.TrimStart('~')
.TrimStart(Path.DirectorySeparatorChar)
.Replace("/", "\\");
if (!File.Exists($"{this.appStatus.ApplicationMapPath}\\{relativePath}"))
{
return resource;
}
// Update virtual and resolved paths once RTL file is confirmed
var rtlFilePath = Path.ChangeExtension(resource.FilePath, ".rtl" + ext);
resource.FilePath = rtlFilePath;
resource.ResolvedPath = this.ResolvePath(rtlFilePath, resource.PathNameAlias);
Why This Fix ResolvedPath already represents the physical file location in DNN |
|
I've pushed an update which uses the |
uzmannazari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Fixes #6885