#12614 closed defect (fixed)
[regression] problems with lang/dir attributes getting set to undefined, causing exceptions loading language files
Reported by: | nicola.besagni | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.6.1 |
Component: | Parser | Version: | 1.6.0 |
Keywords: | dojo.html.set | Cc: | |
Blocked By: | Blocking: |
Description (last modified by )
I want dynamically loading a dom tree from a string (actually a server response). I've trouble with a ValidationTextBox into a ContentPane.
See this fragment (the same code work fine in dojo 1.5 or using dijit.form.TextBox instead of dijit.form.ValidationTextBox)
*
(fragment deleted, see attachment bug_12614.html instead)
from firebug I see this
Error: Bundle not found: validate in dijit.form , locale=undefined Error parsing in _ContentSetter#Setter_dijit_layout_ContentPane_0_1 Error: Bundle not found: validate in dijit.form , locale=undefined Error undefined running custom onLoad code: This deferred has already been resolved
Attachments (5)
Change History (22)
comment:1 follow-up: 2 Changed 10 years ago by
Keywords: | dojo.html.set added; dojox.html.set removed |
---|---|
Summary: | Dinamically loading a ValidationTextBox and ContentPane does not work in dojo 1.6 → Dynamically loading a ValidationTextBox and ContentPane does not work in dojo 1.6 |
comment:3 Changed 10 years ago by
Now I see the in my code fragment the var content declaration is
var content = ;
this is an copy and paste error (!) ; my real code has
var content = ;
I've attached it in test.html
I confirm that it not work in IE8 and FF5.0 Thanks
comment:4 Changed 10 years ago by
OK, do you really mean FF5.0? FF4 was just released, I don't think there's a FF5. Your test file is working fine in FF4 and IE8 for me, no errors in the console.
comment:5 Changed 10 years ago by
sorry, sorry, sorry, sorry, sorry, sorry, sorry, sorry, sorry !!!
FireFox? version 3.6.16 Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.2.16) Gecko/20110319
on Windows XP SP3
I try some other test
sorry
Changed 10 years ago by
Attachment: | domFailure.txt added |
---|
Changed 10 years ago by
Attachment: | domSuccess.txt added |
---|
comment:6 Changed 10 years ago by
I try again on FF3.6.16 I see in console the follows errors
Error: Bundle not found: validate in dijit.form , locale=undefined Line 0
Error parsing in _ContentSetter#Setter_dijit_layout_ContentPane_0_1 Error: Bundle not found: validate in dijit.form , locale=undefined
Error undefined running custom onLoad code: This deferred has already been resolved http://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dijit/layout/ContentPane.xd.js Line 8
You see the risulting html dom in attached file domFailure.txt; see <div> with dojoType=dijit.form.ValidationTextBox? are not parsed
if I change code in
dojo.require("dojo.parser"); ... dojo.html.set(srcNodeRef, content, {parseContent: false}); dojo.parser.parse();
(i.e. running the parser manually ) all work fine !!!
comment:7 follow-up: 8 Changed 10 years ago by
So if you run http://bill.dojotoolkit.org/test.html on FF3.6 you get those errors? It works fine for me.
comment:8 Changed 10 years ago by
On FF3.6 I get the error, but now I've understood our different result: different locale. Try my last attached file (bug_12614.html), with explicit setting of locale in djConfig.locale = "it_it" (get error). If I change locale = "en_us" all work fine.
comment:9 Changed 10 years ago by
Owner: | set to Adam Peller |
---|
Aha. OK, this is one for Adam. BTW it works against a source tree, just not against google CDN.
comment:10 Changed 10 years ago by
note: locales must be specified with a dash (e.g. it-it), not an underscore, though either it_it or en_us should just fall back to the default translations (English)
comment:11 Changed 10 years ago by
Component: | General → Parser |
---|
OK, taking this one back.
The parser (and perhaps dojo.html.set()?) is passing in {dir: undefined, lang: undefined} as inherited values to the widget constructors. That calls ContentPane.set("lang", undefined) which calls dojo.attr(domNode, "lang", undefined), which sets lang="undefined" on the ContentPane.domNode.
Then ContentPane calls dojo.parser.parse(), which notices the lang="undefined" string setting on ContentPane.domNode and passes it to child widget ValidationTextBox.
Then ValidationTextBox calls dojo.i18n.getLocalization("dijit.form", "validate", "undefined"), which apparently operates differently in XD mode vs. normal mode, only causing an exception in XD mode, but presumably not loading the right message file in either case.
Anyway, the root problem is that dir and lang shouldn't be passed as parameters to widget constructors unless they have valid values. So I'll fix that.
comment:12 Changed 10 years ago by
Milestone: | tbd → 1.6.1 |
---|---|
Owner: | changed from Adam Peller to bill |
Status: | new → assigned |
comment:13 Changed 10 years ago by
Description: | modified (diff) |
---|---|
Summary: | Dynamically loading a ValidationTextBox and ContentPane does not work in dojo 1.6 → [regression] problems with ang/dir attributes getting set to undefined, causing exceptions loading language files |
comment:14 follow-up: 15 Changed 10 years ago by
Summary: | [regression] problems with ang/dir attributes getting set to undefined, causing exceptions loading language files → [regression] problems with lang/dir attributes getting set to undefined, causing exceptions loading language files |
---|
comment:16 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [24277]) Fix issues with widgets being instantiated with {dir: undefined, lang: undefined} parameters, or worse yet {dir: "undefined", lang: "undefined"}. Don't pass in dir, lang as parameters unless they have valid (non-null, non-empty-string) values.
Fixes #12614 on 1.6/ branch (trunk checkin will follow), !strict.
comment:17 Changed 10 years ago by
(In [24278]) Fix issues with widgets being instantiated with {dir: undefined, lang: undefined} parameters, or worse yet {dir: "undefined", lang: "undefined"}. Don't pass in dir, lang, textdir as parameters unless they have valid (non-null, non-empty-string) values.
Also fixing bug when parser called with rootNode parameter (where rootNode is not <body>), where it would ignore dir/lang/textDir settings on rootNode.
Fixes #12614 on trunk !strict.
It works for me on FF 3.6/mac. I'm using the attached test case, which is just your test case reformatted. What browser fails for you?