Hi Brad, do you ever sleep?
The file index.cfm in admin views widgets
That code is inside of a loop over prc.widgets. When you dump and abort you’re only dumping out the first one, but the error is probably in a later iteration of the loop.
Try either dumping out the entire prc.widgets query or put a try/catch around the erroring line and dump out the specific record that is erroring.
If I were to guess, the plugin column of the result set is supposed to be the actual instance of the CFC. There’s probably an error causing one of the CFCs to not be instantiated.
Ahh yes, line 150 of WidgetService.cfc wraps a try.catch around the creation of the plugin. If it fails, it logs a message in your error log, but it doesn’t actually rethrow the error or remove that widget from the result set. I would say we should tighten that up a little. It’s not bad that we’re catching the error, but we might as well have not caught it in the first place since we’re simply returning a corrupted query object that is just going to cause an error in the view.
I’m tempted to say that we should just throw the error right then in the widget service. The only problem is that is renders the entire widget interface useless if you have one bad widget. Perhaps we can still catch the error, but modify the result in such a way that the view can still render successfully, but will have a notice on the screen that lets you know what widgets didn’t load correctly. I like that idea best. Luis?
If I recall, Luis ran into this issue during one our ColdBox Developer Week sessions when he had a syntax error in a widget and the screen was erroring. let me dig up the ticket he created to enhance the error reporting.
… Brad goes and searches JIRA…
Ahh yes, here we go:
From the looks of the diff, that’s just what Luis did:
Ahh, our minds must think alike. Ok, well that basically nullifies (or confirms?) most of what I typed above. I think the takeaway is you’ve got one bad widget in the mix and the next version of ContentBox will make it a lot easier to debug the bad one For now, check your error log for the actual error. (You may need to configure an appender if there isn’t one set up in the main ColdBox config)
ColdBox Platform Evangelist
Ortus Solutions, Corp
ColdBox Platform: http://www.coldbox.org