Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#17787 closed defect (worksforme)

Error: _closePopup object is null or undefined.

Reported by: devicifer Owned by: devicifer
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.9.2
Keywords: Cc:
Blocked By: Blocking:

Description

I have implemented a Dijit based menu bar for our application, which is built based upon table entries in a database. The bar works fine most of the time, but can be relied upon to occasionally give the error: Unable to get value of the property '_closePopup': object is null or undefined. Line 165 in dijit/_MenuBase.js

There does not appear to be a reason for this error. The way I reproduce it is to simply navigate between two pages over and over again. Eventually, the error resurfaces. I suggest adding a check for null/undefined.

Change History (8)

comment:1 Changed 6 years ago by devicifer

I should also say that this error is shown upon selecting a menu entry, after the page has fully loaded. The error pops up and then the page navigates as expected, once the error pop-up is closed. The error doesn't affect functionality, but it appears so often that we can't go into production with Dijit because of it.

comment:2 Changed 6 years ago by devicifer

Here's another fun detail: It doesn't happen when I use the .uncompressed.js versions. Looks like there are some issues with the compression scheme. This includes version 1.9.3.

comment:3 Changed 6 years ago by devicifer

_closeChild: function(){
	...
	// Close all popups that are open and descendants of this menu
	this.currentPopupItem._closePopup();
	this.currentPopupItem = null;
	...
}

_MenuBase.js needs an if statement:

if(this.currentPopupItem) {
    // Close all popups that are open and descendants of this menu
    this.currentPopupItem._closePopup();
    this.currentPopupItem = null;
}
Last edited 5 years ago by bill (previous) (diff)

comment:4 Changed 5 years ago by bill

Owner: set to devicifer
Status: newpending

It already has that if() statement. It's been there since 2009, from e67599b4b9066b2bfea4edcf5f63c7bfd316e8ad. If you can come up with an isolated test case that show a failure with the current code, please attach it and write a comment here.

Last edited 5 years ago by bill (previous) (diff)

comment:5 Changed 5 years ago by devicifer

Status: pendingnew

Google API _MenuBase 1.9.3

Okay, I'm not sure how I got confused there, but the issue is line 417:

this.currentPopupItem._closePopup();

It's saying that _closePopup is null and this is producing an error. Thus,

if(this.currentPopupItem._closePopup) {

this.currentPopupItem._closePopup();

}

Last edited 5 years ago by devicifer (previous) (diff)

comment:6 Changed 5 years ago by bill

Status: newpending

OK... well AFAIK this.currentPopupItem is only ever set to a PopupMenuItem? or subclass, in which case this.currentPopupItem._closePopup() is defined. But, if you can create an isolated test case that reproduces the problem, and attach it using the "attach file" button, then I'll be happy to add that guard if() clause.

Note that there are lots of place we call _closePopup() so, perhaps they all need to be fixed.

comment:7 Changed 5 years ago by devicifer

Status: pendingnew

For now, I plan on patching the code through Maven. I don't know how I could create an isolated test for something this inconsistent. Sometimes it works, sometimes it doesn't... There doesn't appear to be any clear criteria for it.

comment:8 Changed 5 years ago by bill

Resolution: worksforme
Status: newclosed

OK, well if later on if you come up w/a test case or an explanation of how that's null, let me know.

Last edited 5 years ago by bill (previous) (diff)
Note: See TracTickets for help on using tickets.