Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4288 closed defect (fixed)

"uri" parameter is not defined in scope of method

Reported by: guest Owned by: James Burke
Priority: high Milestone: 1.0
Component: Loader Version: 0.9
Keywords: uri not defined, cross-domain Cc: igorb@…
Blocked By: Blocking:

Description

method:

dojo.xdIsXDomainPath

makes a reference to a parameter "uri", which is not defined anywhere in the scope of the method. This causes a crash and the inability to load a cross-domain module.

patch:

replace uri with this.baseUrl

Change History (4)

comment:1 Changed 12 years ago by James Burke

Component: CorePackageSystem
Milestone: 1.0
Owner: changed from anonymous to James Burke
Status: newassigned

Yes, that does look broken, but can you provide more info on how you hit the error case? I'm able to load modules from the the AOL CDN fine.

Is it a problem when you have a mix of remote and local files? It would be good to get a sample djConfig that you used, as well as the kind of dojo.require call that breaks so that I can properly reproduce the problem.

comment:2 Changed 12 years ago by guest

Company name removed for privacy purpose:

I've replaced all occurrences of my company's name with {company} or something to that nature. This script is located in a file that will be served neither from my company's CDN and not from AOL's CDN but rather from a third party. Also note the comments i've placed inside the djConfig in order to indicate what works and what doesn't.

djConfig = {

isDebug: false, useXDomain: true, xdWaitSeconds: 10, baseUrl: "http://{company CDN}/", modulePaths: {

company: "http://{company CDN}/{path to company}" This works (our hack) company: "/{path to company}" this causes a crash, is how we would expect it work

}

};

</script> <script type="text/javascript" src="http://o.aolcdn.com/dojo/0.9.0/dojo/dojo.xd.js.uncompressed.js"></script> <script type="text/javascript">

dojo.require("{company}.widget.AbstractObject?");

dojo.addOnLoad(

function() {

var abstractClass = new {company}.widget.AbstractObject?("/search?", true); dojo.byId("test").innerHTML = abstractClass.getServerBase();

});

</script>

comment:3 Changed 12 years ago by James Burke

Resolution: fixed
Status: assignedclosed

(In [10356]) Fixes #4288. Bad variable reference from a refactor. Fixes loading if the page uses an xdomain baseUrl and relative paths to that for the modulePaths.

comment:4 Changed 12 years ago by James Burke

Thanks for the test scenario, that really helped! Should be fixed now.

Note: See TracTickets for help on using tickets.