Open WillStrohl opened 1 year ago
Hello, I found out why this happened.
This comes from a javascript file that handles the "Copy Url" option, I'm still trying to find where the js files come from. But if you open the js file directly "\DesktopModules\ResourceManager\Scripts\dnn-resource-manager\p-cd690c99.entry.js".
The problem is in this part of the code.
My solution in this case was:
This is because the element containing the file data contains the full azure storage path but the path relative to the web then this part of the javascript takes care of that adding the protocol and the host. As I said I am still understanding how this project works and I don't know where these js are being generated but this can work as a hot-fix.
Searching for navigator.clipboard.writeText
in the project leads me to the source of that JS:
https://github.com/dnnsoftware/Dnn.Platform/blob/a2014252657bae998c50eedfbef185dc2cde06d4/DNN%20Platform/Modules/ResourceManager/ResourceManager.Web/src/components/actions/dnn-action-copy-url/dnn-action-copy-url.tsx#L14-L17
We'd welcome a PR with a fix. I might just check for //
or :
rather than http
, but otherwise that looks like a solid fix. Thanks for tracking it down!
Great stuff... Thanks, @PabloSR06 & @bdukes!
Is there an existing issue for this?
What happened?
We enabled the built-in Azure Storage connector, then connected it to an Azure blog storage location. After synchronizing the files, the resulting links in the Resource Manager are prepended with the portal alias. These URLs are already fully qualified URLs.
Steps to reproduce?
Current Behavior
THe folders appear, but clicking on a file to see the URL will yield a surprising result. The URLs for all cloud files have the portal alias prepended to it, creating a bad link.
The URL looks something like this:
https://www.example.comhttps//BLOBLNAME.blob.core.windows.net/FOLDERNAME/FILENAME.png?sv=2023-08-25&sr=b&si=DNNFileManagerPolicy&sig=53MzIMXOjSVgjwYcqYECZet%2Fxh%2F%2WIWWH%2Fue0ja7HD073A%3D
Expected Behavior
The generated URL is correct and can be used.
The actual URL should be this:
https//BLOBLNAME.blob.core.windows.net/FOLDERNAME/FILENAME.png?sv=2023-08-25&sr=b&si=DNNFileManagerPolicy&sig=53MzIMXOjSVgjwYcqYECZet%2Fxh%2F%2WIWWH%2Fue0ja7HD073A%3D
Relevant log output
Anything else?
No response
Affected Versions
9.12.0 (latest release)
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge
Code of Conduct