Doh…completely forgot about that.
So, I put that into my module configuration and it SEEMS to work, but when I put this…
function onLoad( event, interceptData, rc, prc ){
if (!wirebox.getInstance(“SessionStorage@cbstorages”).exists(“currentprojectspace”)) {
wirebox.getInstance(“SessionStorage@cbstorages”).set(“currentprojectspace”,456); // <— line 117 for example error below
};
(also tried afterAspectsLoad() ), the error tells me…
Element CBSTORAGE is undefined in SESSION.
�
The error occurred in /Users/mikecraig/repo/misc/modules/cbstorages/models/SessionStorage.cfc: line 117
Called from /Users/mikecraig/repo/misc/modules/cbstorages/models/SessionStorage.cfc: line 40
Called from /Users/mikecraig/repo/misc/modules_app/productadmin/ModuleConfig.cfc: line 116
I checked the sessionstorage cfc on that line of code and basically, it’s fail point starts at my call to set the value into session storage that I want and in the actual cfc, it first checks to see if cbstorage exists in session…if not, it creates it first then sets it…to which it is telling me that cbstorage does not exist in session.
if I drop a dump of the session scope inside that if clause first, I get an error saying variable session is undefined. Huh?
It seems that adding dependency correctly but after testing some, the problem is that even those the sessionstorage.cfc first creates session.cbstorage = {} before setting any variable to that structure, the session structure variable disappears and errors out saying session.cbstorage is not defined…and it isn’t…because session does not exist.
I’m pretty confused as this is a really simple example. I’ve removed any other related code chunks to my original problem so that I can simply make sure this variable I’m creating is stuffed into session.cbstorage
I’m a little baffled…certainly have used cbstorages many times before, just never done anything with modules onLoad()…but I still don’t see how these two problems are related.
Wow…I’m open to ideas.