Skip to main content
Ben Nadel at InVision In Real Life (IRL) 2018 (Hollywood, CA) with: Gabriel Zeck
Ben Nadel at InVision In Real Life (IRL) 2018 (Hollywood, CA) with: Gabriel Zeck

Adobe ColdFusion 2025 Bug: getBaseTagData() Doesn't Work Inside Closure

By
Published in Comments (1)

This morning, while trying to get my CFMailML project off the ground, I ran into a strange bug in Adobe ColdFusion 2025. When inside a custom tag, the getBaseTagData() function doesn't work if it's called from within a closure; even if said closure hasn't been passed out of scope. To demonstrate, I have a top-level page which does nothing but invoke a custom tag:

<cf_mytag>

Then, within the mytag.cfm file, I try to call getBaseTagData() twice: once in the main control flow and once inside an IFFE (Immediately-Invoked Function Expression):

<cfscript>

	try {

		// FIRST CALL: outside closure.
		dumpMyTagData();

		(() => {

			// SECOND CALL: inside closure.
			dumpMyTagData();

		})();

	} catch ( any error ) {

		writeDump( error );

	}

	// ------------------------------------------------------------------------------- //
	// ------------------------------------------------------------------------------- //

	/**
	* I dump-out the tag data for the current tag.
	*/
	private void function dumpMyTagData() {

		writeDump( getBaseTagList().listToArray() );
		writeDump( getBaseTagData( "cf_mytag" ) );
		writeOutput( "<br>" );

	}

</cfscript>

If we look at the page output for this Adobe ColdFusion 2025 code, we get the following:

Screenshot of browser showing a successful CFDump of the base tag data followed by an error on the second CFDump.

As you can see, the call to getBaseTagData() throws an error when invoked inside the closure (IFFE). And if you look at the results of the getBaseTagList() function, you'll see that cf_mytag doesn't show up as an available tag in the hierarchy.

This means that any attempt to consume or transform ColdFusion custom tag data inside a .map() or .filter() iterator is likely to fail in a mysterious way.

Note that this works fine in Lucee CFML 6.

Want to use code from this post? Check out the license.

Reader Comments

16,172 Comments

The Adobe Tracker has been broken for the last few days; once it's up, I'll either link to an existing bug here or file a new one.

Post A Comment — I'd Love To Hear From You!

Post a Comment

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel
Managed ColdFusion hosting services provided by:
xByte Cloud Logo