tracker issue : CF-4198444

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

getComponentMetadata().extends contains stale information

| View in Tracker

Status/Resolution/Reason: To Test/Fixed/NotWorthEffort

Reporter/Name(from Bugbase): Evert Nagel / Evert Nagel ()

Created: 03/27/2017

Components: Language, Functions

Versions: 2016,11.0,10.0

Failure Type: Others

Found In Build/Fixed In Build: 2016.0.03.301771 / 2018,0,0,308513

Priority/Frequency: Normal /

Locale/System: / Windows 10 64 bit

Vote Count: 0

Problem Description:
The information about extended components obtained through getComponentMetadata() is refreshed only when the extending object is altered or instantiated, not when the extended component is altered.
This requires frameworks which examine metadata before instantiating, such as Coldbox, to reload twice to apply changes in extended components.

Steps to Reproduce:
Create component foo.cfc:

{code:java}
component {
	property name="prop1" default="prop1";
	//property name="prop2" default="prop2";
}
Create component bar.cfc:
component extends="foo" {
}
{code}

Create template test.cfm:

{code:java}
<cfdump var="#getComponentMetadata('bar').extends.properties#">
<cfset test = createObject("component", "bar")>
<cfdump var="#getComponentMetadata('bar').extends.properties#">
{code}

Call test.cfm
Uncomment second property in foo.cfc
Call test.cfm again


Actual Result:
Displays an array containing one property and an array containing two properties.

Expected Result:
Displays both arrays containing two properties.

Any Workarounds:

Attachments:

Comments:

This change will have runtime performance impact. As components in production are not changed frequently and dynamically, so putting an extra cost on every getComponentMetadata() call will be counter productive. Impact wise it is a very low impact bug.
Comment by Vijay Mohan
29805 | October 08, 2018 10:52:07 AM GMT
I would love to know why this is not worth the effort to do? If the metadata changes on the component, it should be reflected not cached?
Comment by Luis Majano
29802 | October 17, 2018 08:54:27 PM GMT