Opened 6 years ago
Closed 6 years ago
#18455 closed defect (fixed)
dojo/parser wrongly caches constructor with relative MID as key
Reported by: | adros | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.11 |
Component: | Parser | Version: | 1.10.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
dojo/parser caches constructors in '_ctorMap' object and uses strings from 'data-dojo-type' as keys. (optionally joined with strings from 'data-dojo-mixins')
But parser supports relative MIDs (since 1.9, #16112), which may cause problems when they are used as keys.
E.g. lets say that we have widgets:
- 'a/X'
- 'a/Y'
- 'b/X'
- 'b/Y'
- widget 'a/X' has in its template relative reference to 'a/Y': data-dojo-type="./Y"
- widget 'b/X' has in its template relative reference to 'b/Y': data-dojo-type="./Y"
When 'a/X' and 'b/X' are both used in same page, both will be instanced with 'a/Y' as subwidget, which is wrong.
The solution is quite simple: transform MIDs to absolute ones. I will create a pull request.
Change History (3)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
Milestone: | tbd → 1.11 |
---|---|
Status: | new → assigned |
comment:3 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed with bab52a220c2f2b55b90356c15e7e9b3136aa9355 and a55e67827e54b023cc68077e4df8eb6a0bc698f9.
Note: See
TracTickets for help on using
tickets.
https://github.com/dojo/dojo/pull/134