Title:
Internal CFC functions return string variables with a strange non-trimmable preceeding space
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/NotABug
Reporter/Name(from Bugbase): Ari-Ville Fernelius / Ari-Ville Fernelius (Fernis)
Created: 01/20/2014
Components: Language, CF Component
Versions: 10.0
Failure Type: Non Functioning
Found In Build/Fixed In Build: Final /
Priority/Frequency: Critical / Most users will encounter
Locale/System: English / Win 2008 Server R2
Vote Count: 0
Problem Description: CFCs cannot use internal functions to return strings, as they return incorrect and unusable values. Real life case: making CFCs extend utilify.cfc which contains common functions, such as createGUID(). In CF's opinion, returned value is 36 characters long, but it's actually 37, cannot be trimmed. As a result, it cannot be inserted into database with any other workaround but removing the internal CFC function, and replacing it with an external function call to another CFC.
Steps to Reproduce:
mytest.cfm
<cfinvoke component="test.cfc" method="tester">
test.cfc:
<cfcomponent>
<cfprocessingdirective pageencoding="utf-8">
<cffunction name="createA" returntype="string">
<cfreturn "A">
</cffunction>
<cffunction name="tester">
<cfoutput>[#createA()#], length: #len(createA())#, first character: [#left(createA(),1)#]</cfoutput>
</cffunction>
</cfcomponent>
Actual Result: [ A], 1, [ A]
Expected Result: [A], 1, [A]
Any Workarounds: CFCs must not extend a utility library with common functions. Instead, all utility functions must be copy-pasted to every CFC, which is most cumbersome, adds codebase hugely, leads to more bugs and typos, etc.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3696455
External Customer Info:
External Company:
External Customer Name: Fernis
External Customer Email:
External Test Config: My Hardware and Environment details: Tested under Windows Server 2008R2 with CF10 updater 10, Windows 7 with CF 10 updater 13 (latest)
Attachments:
Comments: