Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce
Reporter/Name(from Bugbase): Dave Jones / Dave Jones (Dave Jones)
Created: 04/28/2015
Components: Language, CF Component
Versions: 11.0
Failure Type: Crash
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Win 2012 Server x64
Vote Count: 0
Problem Description:
After installing CF 11 Update 5, function inheritance does not work properly when there are three levels of inheritance.
When calling a function on a child component that is inherited from the child's parent component, required arguments are not passed and an exception is thrown.
The best way to describe this it to follow Steps to reproduce.
Steps to Reproduce:
Create three components having a Grandparent - Parent - Child relationship like this:
<!--- Grandparent.cfc --->
<cfcomponent>
<cfset variables.name = "">
<cffunction name="init">
<cfreturn this/>
</cffunction>
<cffunction name="getName">
<cfreturn variables.name>
</cffunction>
</cfcomponent>
<!--- Parent.cfc --->
<cfcomponent extends="Grandparent">
<cffunction name="init">
<cfargument name="name" required="true" type="string">
<cfset variables.name = arguments.name>
<cfreturn super.init()/>
</cffunction>
</cfcomponent>
<!--- Child.cfc --->
<cfcomponent extends="Parent">
<!--- No init method here. Inherits from Parent.cfc --->
</cfcomponent>
Then, call the init function on Child passing in a name:
<!---
Calling init on Child should pass "name" to Parent.cfc
In CF11 Update 5 this throws an exception.
In CF11 Update 4 (and CF9) this executes without error.
--->
<cfset child = createObject("component", "Child").init(name = "Fred Flinstone")>
<cfoutput>#child.getName()#</cfoutput>
Actual Result:
ColdFusion exception is thrown:
---------------------------------------------------------------------------------------------------------------------------------------
The NAME parameter to the init function is required but was not passed in.
The error occurred in C:/inetpub/wwwroot/dev/superbug/Parent.cfc: line 6
4 : <cfargument name="name" required="true" type="string">
5 : <cfset variables.name = arguments.name>
6 : <cfreturn super.init()/>
7 : </cffunction>
8 : </cfcomponent>
---------------------------------------------------------------------------------------------------------------------------------------
Expected Result:
Calling init on Child succeeds and returns an instance of Child.
Any Workarounds:
This has only been observed with three levels of inheritance. Avoid three levels of inheritance to avoid the bug.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3977916
External Customer Info:
External Company:
External Customer Name: Dave
External Customer Email:
External Test Config: My Hardware and Environment details:
CF11 Update 5
Windows Server 2012 and Windows 8.1
IIS
Attachments:
Comments: