Using ColdBox 6.8.1. I can’t for the life of me ge...
# box-products
d
Using ColdBox 6.8.1. I can’t for the life of me get the bug report to be used. If I’m in a handler and just dump
controller.getColdBoxSettings();
it reports all of the settings as default (with the
customErrorTemplate
being empty. It even says the environment is production, but still doesn’t match my settings as they are set in
/config/Coldbox.cfc
in production or local (or anywhere). But dumping
controller.getConfigSettings()
shows my settings as they are set in my local method. Because of this, any error just gets reported with hardly any info because of there not being a
customErrorTemplate
defined (even though it is in my actual settings). Also, for example, I have to reinit after every change locally because the default settings have handlerCaching set to true. Has anyone seen this before? Not sure what to troubleshoot here.
Here is what I’m dumping…
Here are the configSettings, which show the right stuff…
And the coldBoxSettings, which show the wrong/default stuff…
The real problem is I’m not getting enough info back when developing locally because it isn’t using an error template, even though one is defined in all environments in our Coldbox.cfc.
b
Really hard to follow without seeing your code, but I would assume ColdBox is detecting the wrong environment.
d
Right, hard to give enough details but not too much to get into unnecessary weeds. Hmm.
b
Can you reproduce this issue in a fresh ColdBox app template?
If so, send that over. If not, figure out the difference between the template test and your app 🙂
d
Good question. I'll try that out. We are using cbinertia and I'm wondering if that is related.
For posterity’s sake, the culprit is the Whoops.cfm template itself. Basically, if your environment is not called
development
, you are forced into production mode and will get the BugReport-Public.cfm regardless of any config you have in Coldbox.cfc.
Copy code
// Get exception information and mark the safe environment token
	local.e = oException.getExceptionStruct();
	stackFrames = arrayLen( local.e.TagContext );
	local.safeEnvironment = "development";

	// Is this an Ajax Request? If so, present the plain exception templates
	local.requestHeaders = getHTTPRequestData( false ).headers;
	if(
		structKeyExists( local.requestHeaders, "X-Requested-With" )
		&&
		local.requestHeaders[ "X-Requested-With" ] eq "XMLHttpRequest"
	){
		// Development report
		if( local.eventDetails.environment eq local.safeEnvironment ){
			include "BugReport.cfm";
		}
		// Production Report
		else {
			include "BugReport-Public.cfm";
		}
		return;
	}
This is in combination with cbinertia.
The coworker still on 5.5.2 now gets the newly published images-helper v1.2.1, where he did not before. So whatever you did with the cache-busting must’ve worked.
We’re retrying the build on the server now.