Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10714 closed defect (duplicate)

Dialog error: null bgIframe on page unload

Reported by: Mike Wilson Owned by: bill
Priority: high Milestone: 1.4.2
Component: Dijit Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:


This is a tricky bug with Dijit page unload that has eluded me for a while. The problem is this unprotected call to bgIframe.destroy() in DialogUnderlay?.js:

hide: function(){
	// summary:
	//		Hides the dialog underlay
	this.bgIframe.destroy(); = "none";

At certain page unload occasions bgIframe will be null, causing an exception. Though, as this is at page unload the exception is not always visible. Add an alert before the destroy call, or use IE with MSSE, and do the following to reproduce the bug:

  • open tests/test_Dialog.html
  • click "Show Dialog" and then dismiss it
  • click "Programatic Dialog" and wait for it to pop up
  • leave the last dialog open and navigate away from the page

The page unload destruction process will make _Widget do a

delete this.bgIframe

and later Dialog.js will try to hide the underlay by calling

uninitialize: function(){
	if( || wasPlaying){

which will cause the exception.

The two dialogs are needed because of DOM ordering - the first dialog will be before the underlay in the DOM and the problem will not occur as that dialog is destroyed before the underlay.

(BTW: tested on 1.4.1 but this is not available in Trac menus)

Change History (6)

comment:1 Changed 12 years ago by bill

Milestone: tbd1.5
Owner: set to bill

Ah good catch, I'll fix it. Looks like the root problem is that Dialog is accessing dijit._underlay after it has been destroyed.

comment:2 Changed 12 years ago by bill

Resolution: duplicate
Status: newclosed

Oh actually, this has already been fixed. Dup of #10525.

comment:3 Changed 12 years ago by Mike Wilson

Would it be possible to put this fix in the 1.4 branch also, to be available in 1.4.2? (this bug will show to IE users with debugging enabled)

comment:4 Changed 12 years ago by Mike Wilson

Resolution: duplicate
Status: closedreopened

Could you please please please put this one-line fix in the 1.4 branch as well? This bug is hitting us in production and we would really like to keep consuming Dojo from CDN. Having the fix in 1.4.2 would be sweet...

comment:5 Changed 12 years ago by bill

Resolution: duplicate
Status: reopenedclosed

OK sure, I'll do it under the original ticket, #10525.

comment:6 Changed 12 years ago by Mike Wilson

Thanks :-) I really appreciate it! (and sorry for the nag)

Note: See TracTickets for help on using tickets.