If you run a CFOUTPUT with attributecollection you will get an error cannot find encodefor key in structure
error.
Fails:
<cfset result = queryNew("id,name","Integer,Varchar",[{id=1,name="One"},{id=2,name="Two"},{id=3,name="Three"}]) /> <cfset params={query:'result'} /> <!--- this works ---> <cfoutput query="#params.query#"> #id# - #name# </cfoutput> <!--- this don't work ---> <cfoutput attributecollection="#params#"> #id# - #name# </cfoutput>
Workaround: set a dummy key encodefor
to none
<cfset result = queryNew("id,name","Integer,Varchar",[{id=1,name="One"},{id=2,name="Two"},{id=3,name="Three"}]) /> <cfset params = {query:'result', encodefor:'none'} /> <cfoutput attributecollection="#params#"> #id# - #name# </cfoutput>
We are currently waiting for a hotfix from Adobe.
- 11.06.2016: Fixed in ColdFusion 2016 Updater 2. Hotfix is available via support.
- 04.05.2016: Opened case with support CFOUTPUTwith attributecollection causes "cannot find encodefor key in structure" error.