Can't get setNextEvent() to work

Well it would have to be there, otherwise it would be throwing a method not found error.

Yes, exactly. Yet when he put dump/abort at top of setNextEvent nothing happened so must be wrong set of Coldbox framework files. Now making sure using Coldbox folder local to app just for him to get hands around entire app.

The feeling has been setNextEvent() not firing which I can’t see how possible. I think rather when running test function below -

function test(event, rc, prc) {
var xxx = “yyy”;
writedump(xxx);
setNextEvent(event=“Administration.locations”);
xxx = “zzz”;
writedump(xxx); abort;
}

something bad must be happening in setNextEvent that is trapped in some way. Nothing returned (returntype void) so he sees…

yyy zzz

Maybe way off but once sure working with proper set of Coldbox files should be able to step thru it…

Hi

Problem could be in CF Admin-Console -> Caching

Component cache

Save Class Files

Cache Web Server Paths

I don’t know man. Maybe try rewriting that method in tags or something. I can’t say I’ve ever seen that on CF9 with all the hotfixes.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

CF9 is technically still supported by Coldbox 4, but I wouldn’t say it’s recommend :slight_smile:

I seriously think this is hitting that CF9 bug whereby the engine literally skips a line of your code and doesn’t execute it. I’ve just never seen it after applying all updates. My best recommendation (other than rewriting the code a little to trick the compiler) is to upgrade to a version of CF that is at least supported by Adobe. ACF9 is long-since out of support, so if there is a bug here, you’ll never get a patch for it.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Irvin

Don’t worry, all help MUCH appreciated!

Anyway, I added your code to Application.cfc.
(actually I removed one of your slashes so the path read as “D:\CFDev\caseymr\ecbanners\Coldbox” and not “D:\CFDev\caseymr\ecbanners/Coldbox”).
I removed a key function from Controller.cfc (getCFMLEngine()) just to be sure that I was coming into the right file and yes, it broke straight away.
I put the function back, then ran my test() function, dumping out the variables scope.
I still see only the setNextEvent() in variables, not setNextEvent2()

We will be moving to CF10 at some point in the near future, but I am not sure when. Over this I have no control…

Hi Brad

I re-wrote the function in tags. Everything stated so far in this thread is still the same and unaffected :frowning:

Hi Sana

Indeed, all three are unchecked.

Here’s something…

Variable SETNEXTEVENT2 is undefined

However…

Variable QUOI is undefined

Set Next Event doesn’t return anything so it would be generating that error. I was about to say that ColdFusion 9 does have series issues with code written in script, but your code doesnt show that it is written in script.

FOUND IT!!!

I said it was possibly something stupid, and I guess it was…

Elsewhere in the application there is this file:

\model\ControllerDecorator.cfc

It extends:

“coldbox.system.web.ControllerDecorator”

It contains these notes:

// See: http://wiki.coldbox.org/wiki/ControllerDecorator.cfm

/* Create a component that extends coldbox.system.web.ControllerDecorator, this is to provide all the

  • functionality of an original ColdBox Controller as per the design pattern. Once you have done this,
  • you will create a configure method that you can use for custom configuration when the Controller
  • gets created by the framework on application start. Then it’s up to you to add your own methods or
  • override the original methods. (See API). In order to access the original controller object you will
  • use the provided method called: getController(). */

And it contains this function:

function setNextEvent() {
//writeDump(“hello”); abort;
}

Taking out the function returns Coldbox setNextEvent() to its expected behaviour.

:slight_smile:

Hi Irvin

One last thing…

How do I reverse your change so that the application starts to use the Coldbox installation on the server, not the local one?

I have removed the local copy of the files and set this in the Application.cfc
<cfset this.mappings[ “/Coldbox” ] = “D:\CFDev\Coldbox” /> // That’s the path to the server Coldbox files.

However, it doesn’t seem to take effect. Neither does removing the code altogether. I instead get error messages all complaining about missing templates in the local copy that I just took away.

That should do it. Without a mapping it should be looking local, which is removed (so error is correct). With it you should be fine. Since is dev box you might just want to restart Coldfusion service just to get everything, server and app, restarted fresh after your changes. Shouldn’t be necessary but effective…

I think, however, you just need to restart app. I don’t think reiniting the framework restarts the actual underlying app. Running onApplicationStart should get your mapping set.

Hi Irvin

CF has been restarted. But when removing the code - ie. putting app back to its original state - I get this error:

# Could not find the ColdFusion component or interface D:/CFDev/caseymr/ecbanners/coldbox/system/ioc/config/Binder.cfc.
Ensure that the name is correct and that the component or interface exists.

The error occurred in D:/CFDev/coldbox/system/ioc/Injector.cfc: line 963
Called from D:/CFDev/coldbox/system/ioc/Injector.cfc: line 123
Called from D:/CFDev/coldbox/system/ioc/Injector.cfc: line 92
Called from D:/CFDev/coldbox/system/web/services/LoaderService.cfc: line 175
Called from D:/CFDev/coldbox/system/web/services/LoaderService.cfc: line 78
Called from D:/CFDev/coldbox/system/Coldbox.cfc: line 71
Called from D:/CFDev/coldbox/system/Coldbox.cfc: line 499
|


<br>961 : // Check if just a plain CFC path and build it<br>962 : if( isSimpleValue(arguments.binder) ){<br>**963 : arguments.binder = createObject("component",arguments.binder);**<br>964 : }<br>965 : <br>

|

Note that the missing template is in the Coldbox framework that I removed (D:/CFDev/caseymr/ecbanners/coldbox), but it is being called from Coldbox framework files on the server(D:/CFDev/coldbox), see the stacktrace.

How can that be???

That sounds like a setting in your config file (config/coldbox.cfc). In the wirebox section…

Don’t have a wirebox section. I posted the Coldbox.cfc file a few posts earlier. Can you see anything on it that would cause this?

Irvin

Well you pointed me in the right direction anyway :slight_smile:

In config\WireBox.cfc I found this:
scanLocations = [appMapping & ‘/service’],

Which I changed to this:
scanLocations = [],

I stopped and re-inited the app.

Nothing worked at all…

I put it back the way it was

I stopped and re-inited the app

All is back to normal(!)

I don’t understand it - and I’m not even sure I want to - but all is well, and now I’m back on track.

Thanks to everyone for contributing and helping me solve this.