Open Closed

File Management Module issue when running from virtual dir #5687


User avatar
0
rwright-ruhealth created
  • ABP Framework version: v7.3.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): Layered MVC
  • Exception message and full stack trace:
  • Steps to reproduce the issue:
  • Create an application with ABP Suite commercial using Book example. Fix everything up script wise and pagewise to respect the virtual app path "https://myhost/myapp"- Everything works fine.
  • Add File Management Module via ABP Suite CLI,
  • Launch website at https://localhost/myapp and navigate to File Management from the Menu.
  • Attempt to add a Folder. Nothing happens. browser debugger shows script is not found, because file manager is looking for it in the root of the site at https://myhost/Pages/FileManagement/Directory/createModal.js
  • instead of
  • https://myhost/myapp/Pages/FileManagement/Directory/createModal.js
  • This seems to be hard-coded in the package setup.
  • How can I override the FileManagement script path for Virtual dir / Sub applications?

Thanks.


2 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    It's a problem, we will fix it. your ticket refunded

    You can try to override the abp.ResourceLoader._loadScript javascript method:

    abp.ResourceLoader._loadScript = function (url, loadCallback, failCallback) {
    
        if(url.startsWith("/Pages/FileManagement")){
            url = abp.appPath + url.substring(1);
        }
    
        var nonce = document.body.nonce || document.body.getAttribute('nonce');
        _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
            $.get({
                url: url,
                dataType: 'text'
            })
            .done(function (script) {
                if(nonce){
                    $.globalEval(script, { nonce: nonce});
                }else{
                    $.globalEval(script);
                }
                urlInfo.succeed();
            })
            .fail(function () {
                urlInfo.failed();
            });
        });
    };
    
  • User Avatar
    0
    rwright-ruhealth created

    ABP: To solve the problem as a commercial user, I downloaded and modified the source code for File Manager and that seems to solve all problems. Thank you.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11