Status/Resolution/Reason: Closed/Won't Fix/TooManySideEffects
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 01/16/2014
Components: Language
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: Final /
Priority/Frequency: Major / Some users will encounter
Locale/System: English / Linux All
Vote Count: 1
See:
http://cfmlblog.adamcameron.me/2014/01/unexpected-writeoutput-and-difference.html
Bottom line: CFOUTPUT has special powers that make it differe from writeOutput() and OUTPUT=TRUE which it's documented to not have.
All three should behave the same in the situation documented in my article.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3694950
External Customer Info:
External Company:
External Customer Name: Adam Cameron.
External Customer Email:
External Test Config: Repro:
<!--- testOutput.cfm --->
<cffunction name="usingCfoutput">
TEXT WITHIN usingCfoutput():<br>
<cfoutput>#generateContent()#</cfoutput>
</cffunction>
<cffunction name="usingWriteOutput">
TEXT WITHIN usingWriteOutput():<br>
<cfscript>writeOutput(generateContent());</cfscript>
</cffunction>
<cffunction name="usingOutputTrue" output="true">
TEXT WITHIN usingWriteOutput():<br>
<cfscript>writeOutput(generateContent());</cfscript>
</cffunction>
<cffunction name="generateContent">
<cfset var s = "">
BEFORE CFOUTPUT<br>
<cfoutput>IN OUTPUT<br></cfoutput>
AFTER CFOUTPUT<br>
<cfreturn s>
</cffunction>
<cfsetting enablecfoutputonly="true">
<cfoutput>Calling usingCfoutput():<br></cfoutput>
<cfset usingCfoutput()>
<cfoutput><hr></cfoutput>
<cfoutput>Calling usingWriteOutput():<br></cfoutput>
<cfset usingWriteOutput()>
<cfoutput><hr></cfoutput>
<cfoutput>Calling usingOutputTrue():<br></cfoutput>
<cfset usingOutputTrue()>
Attachments:
Comments: