Opened 9 years ago

Closed 9 years ago

#13207 closed defect (wontfix)

dijit.PopupMenuBarItem bug in dojo-release-1.6.1-src.zip, apache 1.3.3

Reported by: zc Owned by:
Priority: low Milestone: tbd
Component: Dijit Version: 1.6.1
Keywords: PopupMenuBarItem dojo-release-1.6.1-src.zip Cc:
Blocked By: Blocking:

Description

The source release dojo-release-1.6.1-src.zip contains bug, that does not exist in built release (dojo-release-1.6.1.zip). The code below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	

	<script djConfig="useCommentedJson: false,parseOnLoad: false" src="/dojo161r/dojo/dojo.js"></script>

		<style type="text/css">
		@import "/dojo161r/dojo/resources/dojo.css";
		@import "/dojo161r/dijit/themes/claro/claro.css";
	</style>

	<script type="text/javascript">

         dojo.require("dijit.MenuBar");
        dojo.require("dijit.MenuBarItem");
        dojo.require("dijit.PopupMenuBarItem");
        dojo.require("dijit.Menu");
        dojo.require("dijit.MenuItem");
        dojo.require("dijit.PopupMenuItem");
dojo.ready(function(){
    dojo.addClass(dojo.body(),'claro');


    var pMenuBar;
    dojo.addOnLoad(function() {
        pMenuBar = new dijit.MenuBar({},'wrapper');

        var pSubMenu = new dijit.Menu({});
        pSubMenu.addChild(new dijit.MenuItem({
            label: "File item #1"
        }));
        pSubMenu.addChild(new dijit.MenuItem({
            label: "File item #2"
        }));
        pMenuBar.addChild(new dijit.PopupMenuBarItem({
            label: "File",
            popup: pSubMenu
        }));

        var pSubMenu2 = new dijit.Menu({});
        pSubMenu2.addChild(new dijit.MenuItem({
            label: "Edit item #1"
        }));
        pSubMenu2.addChild(new dijit.MenuItem({
            label: "Edit item #2"
        }));
        pMenuBar.addChild(new dijit.PopupMenuBarItem({
            label: "Edit",
            popup: pSubMenu2
        }));

        //pMenuBar.placeAt("wrapper");
        pMenuBar.startup();
     });
});

	</script>

 </head>

 <body class="claro">

 </body>
</html>

causes Opera 11.11 report the following bug (in other browsers the error exists, but is not reported in that extensive manner)

[2011-06-05 11:13:40] JavaScript - http://192.168.57.1/dojo/Noname63.html
Event thread: DOMContentLoaded
Uncaught exception: Error: dijit.PopupMenuBarItem template:tabIndex
Error thrown at line 72, column 37 in (value, key):
    throw new Error(className+" template:"+key);
called from line 130, column 66 in ():
    return method.apply(scope, arguments || []);
called via Function.prototype.apply() from line 123, column 3 in (match, key, format):
    return transform(value, key).toString();
called from line 117, column 1 in (template, map, transform, thisObject):
    return template.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,
called from line 70, column 3 in (tmpl):
    return dojo.string.substitute(tmpl, this, function(value, key){
called from line 97, column 4 in ():
    node = dojo._toDom(this._stringRepl(cached));
called via Function.prototype.apply() from line 142, column 6 in inherited(args, a, f):
    if(f && (base._meta ? proto.hasOwnProperty(name) : f !== opf))
called from line 49, column 3 in ():
    this.inherited(arguments);
called from line 204, column 2 in (params, srcNodeRef):
    this.buildRendering();
called via Function.prototype.apply() from line 136, column 5 in inherited(args, a, f):
    f = proto[name];
Error created at line 72, column 37 in (value, key):
    throw new Error(className+" template:"+key);
called from line 130, column 66 in ():
    return method.apply(scope, arguments || []);
called via Function.prototype.apply() from line 123, column 3 in (match, key, format):
    return transform(value, key).toString();
called from line 117, column 1 in (template, map, transform, thisObject):
    return template.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,
called from line 70, column 3 in (tmpl):
    return dojo.string.substitute(tmpl, this, function(value, key){
called from line 97, column 4 in ():
    node = dojo._toDom(this._stringRepl(cached));
called via Function.prototype.apply() from line 142, column 6 in inherited(args, a, f):
    if(f && (base._meta ? proto.hasOwnProperty(name) : f !== opf))
called from line 49, column 3 in ():
    this.inherited(arguments);
called from line 204, column 2 in (params, srcNodeRef):
    this.buildRendering();
called via Function.prototype.apply() from line 136, column 5 in inherited(args, a, f):
    f = proto[name];

Change History (8)

comment:1 Changed 9 years ago by Douglas Hays

Resolution: worksforme
Status: newclosed

I ran it on Opera 11.11 (which is not supported in dijit btw) and I see no errors other than CSS errors being reported in the error console. Of course, the test file is invalid since you never defined the "wrapper" element that is being referenced.

comment:2 Changed 9 years ago by zc

Resolution: worksforme
Status: closedreopened

I re-downloaded 1.6.1-src.zip today (10.06.2011), cleared cache and the results are as follows (Win XP 32 bit SP3; NOTE: dojo lib is located in-depth, /Eclipse_projects/quickstart/public/JS/dojo161r/):

IE 8.0.6 {{{Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E) Timestamp: Fri, 10 Jun 2011 08:32:23 UTC

Message: dijit.PopupMenuBarItem? template:tabIndex Line: 36 Char: 9 Code: 0 URI: http://127.0.0.1/dojo/Noname63.html

}}}

Safari 5.0.5: Error: dijit.PopupMenuBarItem template:tabIndex Opera 11.11: {{{[2011-06-10 10:36:57] JavaScript? - http://127.0.0.1/dojo/Noname63.html Event thread: DOMContentLoaded Uncaught exception: Error: dijit.PopupMenuBarItem? template:tabIndex Error thrown at line 72, column 37 in <anonymous function: _stringRepl>(value, key):

throw new Error(className+" template:"+key);

called from line 130, column 66 in <anonymous function: dojo.hitch>():

return method.apply(scope, arguments
[]);

called via Function.prototype.apply() from line 123, column 3 in <anonymous function: dojo.string.substitute>(match, key, format):

return transform(value, key).toString();

called from line 117, column 1 in <anonymous function: dojo.string.substitute>(template, map, transform, thisObject):

return template.replace(/\$\{([\s\:\}]+)(?:\:([\s\:\}]+))?\}/g,

called from line 70, column 3 in <anonymous function: _stringRepl>(tmpl):

return dojo.string.substitute(tmpl, this, function(value, key){

called from line 97, column 4 in <anonymous function: buildRendering>():

node = dojo._toDom(this._stringRepl(cached));

called via Function.prototype.apply() from line 142, column 6 in inherited(args, a, f):

if(f && (base._meta ? proto.hasOwnProperty(name) : f !== opf))

called from line 49, column 3 in <anonymous function: buildRendering>():

this.inherited(arguments);

called from line 204, column 2 in <anonymous function: create>(params, srcNodeRef):

this.buildRendering();

called via Function.prototype.apply() from line 136, column 5 in inherited(args, a, f):

f = proto[name];

Error created at line 72, column 37 in <anonymous function: _stringRepl>(value, key):

throw new Error(className+" template:"+key);

called from line 130, column 66 in <anonymous function: dojo.hitch>():

return method.apply(scope, arguments
[]);

called via Function.prototype.apply() from line 123, column 3 in <anonymous function: dojo.string.substitute>(match, key, format):

return transform(value, key).toString();

called from line 117, column 1 in <anonymous function: dojo.string.substitute>(template, map, transform, thisObject):

return template.replace(/\$\{([\s\:\}]+)(?:\:([\s\:\}]+))?\}/g,

called from line 70, column 3 in <anonymous function: _stringRepl>(tmpl):

return dojo.string.substitute(tmpl, this, function(value, key){

called from line 97, column 4 in <anonymous function: buildRendering>():

node = dojo._toDom(this._stringRepl(cached));

called via Function.prototype.apply() from line 142, column 6 in inherited(args, a, f):

if(f && (base._meta ? proto.hasOwnProperty(name) : f !== opf))

called from line 49, column 3 in <anonymous function: buildRendering>():

this.inherited(arguments);

called from line 204, column 2 in <anonymous function: create>(params, srcNodeRef):

this.buildRendering();

called via Function.prototype.apply() from line 136, column 5 in inherited(args, a, f):

f = proto[name];

}}}

Firefox 4.0.1 {{{dijit.PopupMenuBarItem? template:tabIndex http://127.0.0.1/Eclipse_projects/quickstart/public/JS/dojo161r/dojo/_base/_loader/bootstrap.js Line 535}}}

comment:3 Changed 9 years ago by bill

Resolution: worksforme
Status: reopenedclosed

It doesn't error for me either, running on FF3.6/mac or IE8 against the zip, using your test file. As Doug said, your test file is invalid, but even after fixing it I get no error. Anyway, if the source release isn't working for you then you can use the built release (you should be using that anyway).

comment:4 Changed 9 years ago by zc

Resolution: worksforme
Status: closedreopened
  1. It happens so that I am testing with file containing 'wrapper' element.
  2. I am aware what version should and what version of library should not be used. I am not using 1.6.1 src for development due to that error, I switched back to 1.5.
  3. I have tested that on MacOS/Safari 5.0.5 too.
  4. I do not consider the problem solved, thus - reopening.
  5. Sometimes unknown people might be correct in their statements.

The file used for tests looks like that:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title> new document </title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

	<script djConfig="useCommentedJson: false,parseOnLoad: false" src="/Eclipse_projects/quickstart/public/JS/dojo161r/dojo/dojo.js"></script>

		<style type="text/css">
		@import "/Eclipse_projects/quickstart/public/JS/dojo161r/dojo/resources/dojo.css";
		@import "/Eclipse_projects/quickstart/public/JS/dojo161r/dijit/themes/claro/claro.css";
	</style>

	<script type="text/javascript">

         dojo.require("dijit.MenuBar");
        dojo.require("dijit.MenuBarItem");
        dojo.require("dijit.PopupMenuBarItem");
        dojo.require("dijit.Menu");
        dojo.require("dijit.MenuItem");
        dojo.require("dijit.PopupMenuItem");
dojo.ready(function(){
    dojo.addClass(dojo.body(),'claro');


    var pMenuBar;
    dojo.addOnLoad(function() {
        pMenuBar = new dijit.MenuBar({},'wrapper');

        var pSubMenu = new dijit.Menu({});
        pSubMenu.addChild(new dijit.MenuItem({
            label: "File item #1"
        }));
        pSubMenu.addChild(new dijit.MenuItem({
            label: "File item #2"
        }));
        pMenuBar.addChild(new dijit.PopupMenuBarItem({
            label: "File",
            popup: pSubMenu
        }));

        var pSubMenu2 = new dijit.Menu({});
        pSubMenu2.addChild(new dijit.MenuItem({
            label: "Edit item #1"
        }));
        pSubMenu2.addChild(new dijit.MenuItem({
            label: "Edit item #2"
        }));
        pMenuBar.addChild(new dijit.PopupMenuBarItem({
            label: "Edit",
            popup: pSubMenu2
        }));

        //pMenuBar.placeAt("wrapper");
        pMenuBar.startup();
     });
});

	</script>

 </head>

 <body class="claro">
<div id="wrapper"></div>
 </body>
</html>

comment:5 Changed 9 years ago by bill

Priority: highlow

Regardless of how many times you reopen the ticket and say that it doesn't work for you, we cannot fix a problem that we cannot reproduce. If you can post a public URL running your test case, I'll try one more time to look at it.

comment:6 Changed 9 years ago by zc

Having uploaded the very 1.6.1 src I am using locally to some remote server - I cannot reproduce the bug for uploaded file either ...
What could that be - cause connecting to 'buggy' machine (Apache/1.3.33 (Win32) PHP/5.3.0) from another reproduces the bug. Moving library to other dirs does not help. I will upgrade Apache to eliminate 1.3.33 specificity.

comment:7 in reply to:  6 Changed 9 years ago by zc

Ok, the issue was (Apache/1.3.33 (Win32) PHP/5.3.0), (Apache/2.2 (Win32) PHP/5.3.6) causes no problems.

comment:8 Changed 9 years ago by bill

Resolution: wontfix
Status: reopenedclosed
Summary: dijit.PopupMenuBarItem bug in dojo-release-1.6.1-src.zipdijit.PopupMenuBarItem bug in dojo-release-1.6.1-src.zip, apache 1.3.3

OK good, not sure if this is from a bug in apache (which can be fixed by upgrading), or maybe a timing condition in dojo (which is likely fixed in the 1.7 release). In any case, closing ticket due to the numerous workarounds to the issue.

Note: See TracTickets for help on using tickets.