Can't get setNextEvent() to work

Hi Michael,

Do you know how to use line debugger. ColdFusion Builder-3 to track-down issues like this very easy.

Help video
https://www.youtube.com/watch?v=-hHP7LI9Lgw

If you using Lucee then use

http://www.fusion-debug.com/

Ok, then if you writedump the variables scope at the very top of your test handler and search for “setNextEvent” do you see it?

Hi Irvin

Yes I do!

setNextEvent
function setNextEvent

Arguments:

Name Required Type Default
event Optional string
queryString Optional string
addToken Optional boolean
persist Optional string
persistStruct Optional struct
ssl Optional boolean
baseURL Optional string
postProcessExempt Optional boolean
URL Optional string
URI Optional string
statusCode Optional numeric

ReturnType: void

Roles:

Access: public

Output: false
DisplayName:
Hint: Facade
Description:

Ok, not to get too simple but do you have more than one copy of the Coldbox framework on your server? Just making sure you’re putting the prior writedumps in the proper cfc…

In fact there are three copies on the server(!) But only one of them is in a directory called “coldbox” and it’s that one I’ve been careful to put the writedumps in. (The other two are “coldbox - Copy” and “coldbox2”).

I assume that, in my Coldbox.cfc, if I see a class with, for example, “coldbox.system.interceptors.SES”, I can be certain that the coldbox framework I am pointing at is the one in the directory called coldbox?

Hi Sana

I am still having trouble getting Fusion-Debug set up. Waiting for server admin to check the JVM settings…

I’m using v4 which was a big re-write for Coldbox but you might just verify the following as a test (obviously can be put back). Mainly just making Coldbox local to app.

Comment out if exists in application.cfc “this.mappings[”/coldbox"] = “{somewhere on server}”;" . Commenting out coldbox mapping will make Coldbox look in your app root for Coldbox folder.

Copy Coldbox folder and contents to root if not there already.

Find the setNextEvent function in this folder structure and writedump/abort arguments at top of that function.

It should show up.

Hi Irvin

I copied the coldbox framework from the server root to the application root.

I then put an error into the init() function of the Controller.cfc and reinitialised the app, just to verify I was hitting the right coldbox code. I got the error.

So, I removed the error, reinitialised the app again and hit the test() function, and the result is the same as before. setNextEvent() does not fire.

:frowning:

Sorry, you’re saying writedump/abort at top of setnextevent function doesn’t show?

Yup!

Just on the (really) oddball chance what happens if you change setNextEvent(event=“Administration.locations”); to variables.setNextEvent(event=“Administration.locations”); ?

No difference.

Wow. Well, it just seems impossible. As one last idea to make sure what’s happening how about if you rename the setNextEvent function to setNextEvent2 (only the function itself - not the call to it) and then run. You should get an error since it’s no longer there. If not I’ve got to wonder if the app is really running from that Coldbox root.

Or, same thing but maybe better - rename function and then dump variables scope at top of test function to see if setNextEvent still shows in variables scope. If it does then that’s not the folder it’s running on…

What makes me wonder about that is I forgot you might have /Coldbox mapped at server level.

Okay, well that’s interesting…

I renamed the function to setNextEvent2()
I broke the init() function, again just to check.
fwreinit=1
error!
fixed the init() function
fwreinit=1

no error
ran test(), writedumping the variables

I can see a setNextEvent() , not a setNextEvent2().

Would you like to see my /config/Coldbox.cfc and Application.cfc ?

Sure, that sounds good. I’m thinking /Coldbox is mapped at server level is why we’re not hitting right folder. I think if you set map directly in app to override then we’ll know we’re looking at proper copy. Is this.mappings["/coldbox"] = “[wherever you want]”; in application.cfc…

In fact, it’s nowhere!

Files attached…

Coldbox.cfc (9.26 KB)

Application.cfc (3.5 KB)

Hi Michael,

I am more than happy to have gotomeeting like “video conference” to help you in fix the issue. Please let me know.

I think if you add this (below) to your application.cfc and reinit entire app you’ll now see your setNextEvent2 if you dump variables in test function…

<cfset this.rootDir = getDirectoryFromPath(
getCurrentTemplatePath()
) />
<cfset this.mappings[ “/Coldbox” ] = this.rootDir & “/Coldbox” />

BTW, not trying to send on wild goose chase and none of this may solve anything. Just trying to make sure that what you’re looking at is what you’re looking at if you know what I mean…