Skip to content

Instantly share code, notes, and snippets.

@bennadel
Created June 16, 2021 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennadel/b74ca8d4187c671b610714398f28186c to your computer and use it in GitHub Desktop.
Save bennadel/b74ca8d4187c671b610714398f28186c to your computer and use it in GitHub Desktop.
Strange Variable-Name Error When Writing To Base Tag In Adobe ColdFusion 2018
<cfscript>
parentTag = getBaseTagData( "cf_parent" );
variableName = "$$entity:h1:small-title";
parentTag[ variableName ] = true;
writeDump( parentTag );
</cfscript>
<cfscript>
parentTag = getBaseTagData( "cf_parent" );
variableName = "$$entity:h1:small-title";
// NOTE: This time, I am explicitly referencing the VARIABLES scope in the parent
// tag. I'm not relying on Adobe's magical handling of the parent tag context.
parentTag.variables[ variableName ] = true;
writeDump( parentTag );
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment