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: https://bugbase.adobe.com/index.cfm?event=bug&id=3909707.

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>
</cffunction>

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 senior developer evangelist for Adobe. He focuses on document services, JavaScript, 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 https://www.raymondcamden.com

Archived Comments

Comment 1 by Nathan Strutz posted on 12/15/2014 at 10:45 PM

I guess I'm too late to correct you or anything, but FYI, CFScript Community Components has had a working cfscript wddx component for a few years now: https://github.com/CFCommun...

I always put them in /com/munity/ because it sounds good when I read it :)