Opened 11 years ago

Closed 11 years ago

#7993 closed defect (fixed)

dijit._Templated escape sequence for quote replacement fails with compound values

Reported by: James Burke Owned by: bill
Priority: high Milestone: 1.3
Component: Dijit Version: 1.2.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

I want a token that should skip the double-quote escaping. It is called i18n.foo, so I reference it in the template like so:

${!i18n.foo}

However, that does not work. The key is not found. I believe this issue is at line 44 in dijit._Templated._stringRepl():

if(key.charAt(0) == '!'){ value = _this[key.substr(1)]; }

I believe for my key above, it is trying to look for _this["i18n.foo"], but I really want _this.i18n.foo.

Perhaps switching to something like this would work:

if(key.charAt(0) == '!'){ value = dojo.getObject(key.substr(1), false, _this); }

Change History (4)

comment:1 Changed 11 years ago by James Burke

Description: modified (diff)

comment:2 Changed 11 years ago by bill

Description: modified (diff)

Makes sense, that's how dojo.string.substitute does it (which is the code path that we follow when there is no ! mark).

Feel free to check that in if it's working for you.

comment:3 Changed 11 years ago by bill

Milestone: tbd1.3
Owner: set to bill
Status: newassigned

comment:4 Changed 11 years ago by bill

Resolution: fixed
Status: assignedclosed

Fixed in [15646].

Note: See TracTickets for help on using tickets.