cfwddx doesn't work in script - FYI

This post is more than 2 years old.

This will probably impact about three people, but as I ran into it, I thought I'd share. In ColdFusion 11, you were supposed to be able to call pretty much any tag from cfscript. Unfortunately, cfwddx doesn't work. And yeah, I actually need it. (I used it to store some complex data for CFLib and I'm working on a migration script to convert it to MongoDB.) Here is the bug report in case anyone wants to vote for it:

As a quick aside, I wrote this to get around it. The syntax is actually shorter than what I would have used if the feature worked.

<cffunction name="decodeWddx">
	<cfargument name="input">
	<cfset var output = "">
	<cfwddx action="wddx2cfml" input="#arguments.input#" output="output">
	<cfreturn output>

Oops - it DOES work! This is what I get for coding too fast. My issue was trying to do x=cfwddx(...) as opposed to just cfwddx by itself. In my opinion, what I wrote should have worked with x simply being undefined, but, whatever. I'm keeping my UDF as it is quicker to use anyway, but please forgive this misfire on a bug report!

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate for HERE Technologies. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA