Created
June 16, 2021 12:12
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
parentTag = getBaseTagData( "cf_parent" ); | |
variableName = "$$entity:h1:small-title"; | |
parentTag[ variableName ] = true; | |
writeDump( parentTag ); | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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