Opened 16 years ago

Closed 15 years ago

#625 closed defect (wontfix)

dojo.uri.Uri not playing well with djConfig.baseRelativePath

Reported by: [email protected] Owned by: jkuhnert
Priority: high Milestone: 0.9
Component: Core Version: 0.2
Keywords: Cc:
Blocked By: Blocking:


The supplied patch fixes a problem which may only affect tapestry, but is rather large in impact if someone else is relying on this behaviour. I've tested the basic test_*.html files, but the one uri.js test source is of course broken as this patch changes the way paths are interpreted.

Problem:My uses require setting a djConfig.baseRelativePath string so that dojo can correctly resolve paths. For example, one case of this path might be baseRelativePath:"javascript/dojo". That's all fine and well, but when you have a more complicated path (such as the case with tapestry), the baseRelativePath may look something more like baseRelativePath:"http://host/app?query=valueetclkjsfal". In this instance I need the entire baseRelativePath given to be used to resolve all resources.

The problem is that the dojo.uri.Uri() initializer constructs a new Uri object out of the base path and then only picks off the path parts that create the basic "scheme:authority//host/a/b/" portions, leaving all query strings and such stripped off. So, the resulting baseRelativePath doesn't end up actually being what you specified, it instead turns into the shorter form.

Solution: The soltion used was to more or less cut out a lot of code in the initializer. It doesn't try and re-construct the url using portions of the original baseRelativePath and incoming relative path strings anymore. (at least not in the core it was happening in).

I can't think of a use case where this would break someones functionality, unless they wanted to be able to pass in a URL string to baseRelativePath and have it auto-cleaned for them.

The other possible solution might be to replace dojo.uri.dojoUri with a new implementation that doesn't destrory baseRelativePath, but leaves the existing functionality in the Uri initializer in order to not risk breaking something for somebody. (though it's very hard to tell who might be using it this way as it seems fairly counter-intuitive to me)

This is a complete blocker for me adding dojo into tapestry. I could patch Uri.js but I'm sort of against doing weird local patches of libraries.

Attachments (1)

dojo-uri-patch.txt (1.9 KB) - added by [email protected] 16 years ago.
The referenced patch

Download all attachments as: .zip

Change History (6)

Changed 16 years ago by [email protected]

Attachment: dojo-uri-patch.txt added

The referenced patch

comment:1 Changed 16 years ago by anonymous


comment:2 Changed 16 years ago by dylan

Owner: changed from anonymous to jkuhnert

comment:3 Changed 16 years ago by jkuhnert

Milestone: 0.40.5
Status: newassigned

comment:4 Changed 15 years ago by Adam Peller

Jesse, this has been idle for 11 months. Is it still valid? What's the plan?

comment:5 Changed 15 years ago by jkuhnert

Resolution: wontfix
Status: assignedclosed

Ugh...There are still problems actually - but I have no idea if they exist in 0.9 or not. I guess we could close it out for now and if I hit it whenever I do dojo 0.9 then I'll re-address it then.

Note: See TracTickets for help on using tickets.