aaronfish
1 post
|
Topic: Help/Bug /
Help! this.options.parent is null or not an object
Ok I’m running into this as well. Thankfully I tracked down 1.2 to revert to if need be, but I’ve been sitting here comparing a diff of windows.js to try to track it down. I’m getting the error on the same line that threejohn is. I’m running firefox 2.0.0.6 and the prototype 1.6 RC incidentally.
I’ll try to trace the logic backwards because something doesn’t quite seem right (no offense intended of course). It could just be that there is some quirk of javascript I’m not aware of. Also forgive me covering every little detail I notice, I’m trying to be complete with this analysis. Ok starting from the error, on line 1495, it tries to access parameters.options.parent. This is the only reference to anything under parameters.options in this function and actually is the only difference between 1.3 and 1.2 in this function (previously WindowUtilities.getPageSize didn’t take arguments). In my case as I’m calling it from a confirm dialog, backing up a step takes us to the end of the confirm function at line 1429. Nothing changes between 1.2 and 1.3 for this function. There is some manipulation of the parameters variable, but no reference to the parameter.options. Nothing that sends the parameters argument outside this function for manipulation either, in fact the only assignment reference I can find that is close to matching ”.options.parent” is on line 112, and is part of the window object initializer (which doesn’t seem to be triggered by the time it hits 1495).
I’ve managed to break out the offending function call to a sample page (that still fails in IE and firefox). However it isn’t anywhere that I can post a link to, so here it is:
<html>
<head>
<script type="text/javascript" src="content/js/prototype.js"></script>
<script type="text/javascript" src="content/js/window/window.js"></script>
<script type="text/javascript" src="content/js/window/debug.js"></script>
<link href="content/js/window/default.css" rel="stylesheet" type="text/css"/>
<link href="content/js/window/spread.css" rel="stylesheet" type="text/css"/>
<link href="content/js/window/debug.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<script type="text/javascript">
showDebug();
Dialog.confirm("<h1>Session Locked</h1><br>Your session is locked due to inactivity, to continue where you left off, you will need to re-authenticate.<br>"+
"Failure to do so in a timely manner, you will automatically be logged off.<br><br>"+
"<div align='center'><table class='autologinform'>"+
"<tr><th align='left'>Name</th><td>"+name+"</td></tr>"+
"<tr><th align='left'>Password</th><td><input type='password' id='autologinpwd' name='autologinpwd' /></td></tr>"+
"</table><div id='autologinwarning' style='font-weight: bold; color: red;'> </div></div>",
{okLabel: 'Login', cancelLabel: 'Logout', className: "acubedark",
onCancel: function(win) { window.location=app_root+'/logout.php'; },
onOk: function(win) {
winTemp = win;
new Ajax.Request(app_root+'/ajax/login.php', {parameters: $('autologinpwd').serialize(true), asynchronous: false});
winTemp = null;
}});
</script>
</body>
</html>
|