Issue with event.renderdata() and messagebox custom css [coldbox-3.8.0]

Hi,

We’re getting a weird issue where the messagebox custom css styles are getting appended to the content rendered by event.renderData(). We’re trying to render json and the returned string looks like the example below:

<style type="text/css">
.cbox_messagebox{
	font-size: 13px;
	font-weight: bold;
	margin: 10px;
}
.cbox_messagebox_info{
	background: #D1E6EF url(/coldbox/system/includes/images/cmsg.gif) no-repeat scroll .5em 50%;
	border: 1px solid #2580B2;
	margin: 0.3em;
	padding: 0pt 1em 0pt 3.5em;
}
.cbox_messagebox_warning{
	background: #FFF2CF url(/coldbox/system/includes/images/wmsg.gif) no-repeat scroll .5em 50%;
	border: 1px solid #2580B2;
	margin: 0.3em;
	padding: 0pt 1em 0pt 3.5em;
}
.cbox_messagebox_error{
	background: #FFFFE0 url(/coldbox/system/includes/images/emsg.gif) no-repeat scroll .5em 50%;
	border: 1px solid #2580B2;
	margin: 0.3em;
	padding: 0pt 1em 0pt 3.5em;
}
</style>
"7F47A716-A178-646D-148BC99A50200797"

Has anyone encountered this issue before or know a way to remove the messagebox styling out of the request context?

This is on production so it's something that we need to fix fairly urgently.

Many thanks in advance,
Tom

​Does your handler or view use the messagebox in that even handler?​

Hi Andrew,

Thanks for your reply. No, it wasn’t directly calling messagebox. However, I think we found out where the issue was. It was one of our security components invoked in the Main handler’s preHandler() method that was throwing a warning message that was trickling down through the request context. The messagebox custom css file has a cfhtmlhead call in it so I guess it may have something to do with that.

Not sure if it should be getting into a renderData call’s request context but, for what it’s worth, we ended up finding a workaround so the main issue was resolved.

Thanks again,
Tom