Title:
cfouput around cftry causes Undefined Variable in UDF with struct as argument
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): Brian Paulson / Brian Paulson (Brian Paulson)
Created: 05/17/2015
Components: Language
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Major / All users will encounter
Locale/System: ALL / Windows 7 SP1 64-bit
Vote Count: 1
Problem Description:
When you have a cfouput around a cftry block and within that try block you have a function call that has a struct with variables inside it the variables in the struct will be undefined, and will not be caught in the try catch aroung the block, but as an unhandled error.
Steps to Reproduce:
<cfoutput><cftry>
<cfset cdata ="Test">
#outputTest("test",{"cdata"=cdata})#
<cfcatch type="any">
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
</cfoutput>
<cffunction name="outputTest" output="false">
<cfargument name="id" type="string" default="">
<cfargument name="options" type="struct">
<!--- dont need to do anything in here --->
<cfreturn id>
</cffunction>
Actual Result:
Undefined variable cdata
Expected Result:
string returned from UDF to be output on the page.
Any Workarounds:
<cftry>
<cfoutput>
<cfset cdata ="Test">
#outputTest("test",{"cdata"=cdata})#
</cfoutput>
<cfcatch type="any">
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
<cffunction name="outputTest" output="false">
<cfargument name="id" type="string" default="">
<cfargument name="options" type="struct">
<!--- dont need to do anything in here --->
<cfreturn id>
</cffunction>
Place cfoutput tags inside try catch
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3989302
External Customer Info:
External Company:
External Customer Name: Brian
External Customer Email:
External Test Config: My Hardware and Environment details:
server: windows 7
Attachments:
Comments: