Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#12735 closed defect (fixed)

Tree: saved open/closed state of one tree can interfere with another

Reported by: bill Owned by: bill
Priority: high Milestone: 1.7
Component: Dijit Version: 1.6.0
Keywords: Cc:
Blocked By: Blocking:


In Tree.js, postMixInProperties() does:

	this.cookieName = + "SaveStateCookie";

If the Tree doesn't have an id specified (ex: new Tree{{id: "foo"})), an id is auto-generated. The problem is that the auto-generation occurs after the code above runs.

Workaround: just specify an id on your trees

Change History (5)

comment:1 Changed 11 years ago by bill

But… if the Tree's ID is auto-generated I think we might be better off not doing any cookies, because an auto-generated id could easily change, or be duplicated across pages (for a multi-page application).

comment:2 Changed 11 years ago by bill

Resolution: fixed
Status: newclosed

Fixed in [24462], trac missed the commit again.

comment:3 Changed 11 years ago by Adam Peller

Could there still be a collision problem with Trees running prior to 1.7 which had "SaveStateCookie?" recorded as a cookieName without an id?

comment:4 Changed 11 years ago by bill

There should be no collision. Although that cookie may still be in users' browsers' caches, it won't be accessed. After upgrading to 1.7 Tree won't look for a cookie unless it has an explicit id, and in that case it will look for a different cookie name.

comment:5 Changed 10 years ago by bill

In [28254]:

Don't try to save tree state if cookieName is undefined (which happens when there's no user specified id). Fixes #15088, refs #12735 !strict.

Note: See TracTickets for help on using tickets.