Adobe-Consulting-Services / acs-aem-commons

http://adobe-consulting-services.github.io/acs-aem-commons/
Apache License 2.0
453 stars 600 forks source link

DynamicClassicUIClientLibraryServlet does not take into consideration context path #1187

Closed bdhoine closed 6 years ago

bdhoine commented 6 years ago

when fetching the clientlibs the context path is not in the response

// 20171128124815
// http://*:4502/MB027200/bin/acs-commons/dynamic-classicui-clientlibs.json

{
  "js": [
    "/apps/acs-commons/widgets/configure-limit-parsys.min.js",
    "/apps/acs-commons/widgets/configure-parsys-placeholder.min.js"
  ],
  "css": [

  ]
}

so when the dynamic loader javascript inserts the scripts they can not be found

(function() {
    CQ.HTTP.get("/bin/acs-commons/dynamic-classicui-clientlibs.json", function(options, success, response) {
        var data, i, el,
            head = document.getElementsByTagName("head")[0];
        if (success) {
            data = JSON.parse(response.responseText);
            if (data.js) {
                for (i = 0; i < data.js.length; i++) {
                    el = document.createElement("script");
                    el.type = "text/javascript";
                    el.src = data.js[i];
                    head.appendChild(el);
                }
            }
            if (data.css) {
                for (i = 0; i < data.css.length; i++) {
                    el = document.createElement("link");
                    el.rel = "stylesheet";
                    el.type = "text/css";
                    el.href = data.css[i];
                    head.appendChild(el);
                }
            }
        }
    });
})();
justinedelson commented 6 years ago

fixed with #1188