I’ve set up a custom invalidEventHandler value in my Coldbox config.cfc file, but for some reason any time I execute an invalid handler, I get the following exception error message:
“The invalidEventHandler setting is also invalid: error.onInvalidEvent. Please check your settings”
I do have a handler called “Error.cfc” and it does have a method in it called “onInvalidEvent” which calls a basic 404.cfm view file. I can’t figure out why Coldbox doesn’t display my configured handler.
Note: I already ran box update in Commandbox to make sure all of my dependencies are up to date. I also attempted running both Lucee and ACF 2016 and I still get the same problem.
If anyone has any tips for troubleshooting the root cause, please do share! I very much appreciate the insight!
I’ve just run into the same issue. Coldbox v.5.6.2+1021. Having invalidEventHandler=“Main.onInvalidEvent” configured in Coldbox.cfc results in the “The invalidEventHandler setting is also invalid: error.onInvalidEvent. Please check your settings” error.
Well, this is just masking the symptoms. Changing the framework is not the solution. I don’t know what system this runs on, but one thing I noticed is that in the configuration “error.onInvalidEvent” is without capital E, but the handler “Error.cfc” is with capital E. Maybe that is something to align?
I am still working on solving the issue. I ran a few more tests on a blank “coldbox create app” and the invalidEventHandler Coldbox setting works as expected. I am not convinced that it is a bug in the framework yet and I will report back here after I learn anything new from my troubleshooting efforts.
I wanted to provide a quick update. I spent some time trying to figure out
the best way to fix this issue so I could submit a pull request.
Unfortunately, I am stuck and think it may take help from someone more
familiar with how cbguard works. In the meantime, I have submitted an
issue on Github for cbguard here:
*Type:* HandlerService.InvalidEventHandlerException
*Message:* The invalidEventHandler event is also invalid
*Detail:* The invalidEventHandler setting is also invalid:
Main.pageNotFound. Please check your settings
*Timestamp:* 04/02/2020 04:00:56 PM
@Scott Conklin,
I just submitted a pull request for cbSecurity with the same fix Eric used for cbGuard. Once implemented, it should make using the invalidEventHandler setting safe for apps that use cbSecurity as well.
Sorry for the delay on this, I had meant to submit an issue or PR earlier.