tracker issue : CF-4131212

select a category, or use search below
(searches all categories and all time range)
Title:

Variable value did not pass to the template when using CFINCLUDE

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Betty Chen / Betty Chen (Betty Chen)

Created: 03/22/2016

Components: Language

Versions: 2016

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF2016_Final /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 1

Listed in the version 2016.0.02.299200 Issues Fixed doc
Problem Description: After calling the program from CFINCLUDE, the variable value from the parent program became null.

Steps to Reproduce: <cfinclude template="../xyz.cfm">  (there is a variable called translator_id in xyz.cfm

Actual Result:null

Expected Result:some string value

Any Workarounds:Before use cfinclude, add a cfset statement
<cfset translator_id="#translator_id#">

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4131212

External Customer Info:
External Company:  
External Customer Name: Betty Chen
External Customer Email:  
External Test Config: My Hardware and Environment details: VM server

Attachments:

Comments:

We figured out what caused the lost a variable value when there is a <cfoutput> within a <cfoutput query=””>. See below: The lost variable value. It occurred if there is a <cfoutput> within a <cfoutput query=””>. Below are two simple files to reproduce the issue. In the test_1.cfm file, it calls a query (note that one of the table field has the same name as translator_id). It has a <cfinclude template=”test_2.cfm”> inside the <cfoutput query>. If there is another <cfoutput> inside the <cfoutput query>, then the translator_id’s value can’t pass to test_2.cfm. If I remove the <cfoutput> within the <cfoutput query>, then the translator_id’s value pass through okay. ================================================ Content of test_1.cfm <cfset translator_id = "to_LbmVarian"> <cfquery name="get_component" datasource="interfaces_v2_sql"> SELECT translator_id FROM translators WHERE translator_id = '#translator_id#' </cfquery> <cfoutput> <br>-------------------- <br>test_1.cfm <br>translator_id = '#translator_id#' <br>query result count = #get_component.recordcount# </cfoutput> <cfoutput query="get_component"> <cfoutput> <br>translator_id = '#translator_id#' </cfoutput> <cfinclude template="test_2.cfm"> </cfoutput> Content of test_2.cfm <cfoutput> <br>-------------------- <br>test_2.cfm <br>translator_id = '#translator_id#' </cfoutput> Result when ran: -------------------- test_1.cfm translator_id = 'to_LbmVarian' query result count = 1 translator_id = 'to_LbmVarian' -------------------- test_2.cfm translator_id = ''
Comment by External U.
3246 | March 22, 2016 04:55:38 PM GMT
This issue is fixed and the fix will be available as part of ColdFusion 2016 Update 2.
Comment by Nimit S.
3247 | May 06, 2016 01:37:04 AM GMT
This has happened to us as well. We are performing pre-CF2016 testing for a client and this page will consistently fail for the same reason. A regular CFOUTPUT nested within a CFOUTPUT QUERY=...
Vote by External U.
3250 | June 06, 2016 03:52:12 PM GMT
test note
Comment by CFwatson U.
3248 | June 07, 2016 04:17:58 AM GMT
The fix for this bug is available as part of the early-access build for ColdFusion 2016 Update 2.
Comment by CFwatson U.
3249 | June 07, 2016 04:24:38 AM GMT