tracker issue : CF-4198223

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

For implicit Constructor support not calling setter functions for the properties defined.

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Henry Ho / Henry Ho ()

Created: 12/28/2016

Components: Language, CF Component

Versions: 11.0

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 11,0,11,301867 / 2018.0.0.314090

Priority/Frequency: Normal / All users will encounter

Locale/System: / Windows 10 64 bit

Vote Count: 0

Problem Description:

"For implicit Constructor support, either specify accessors=true in the cfcomponent or ensure that you have the setter functions for the properties defined. "

https://helpx.adobe.com/coldfusion/developing-applications/building-blocks-of-coldfusion-applications/building-and-using-coldfusion-components/implicit-constructor-for-cfc.html

I added a setter for the "ID" property and it is never invoked by the implicit constructor

Steps to Reproduce:

test.cfc
component accessors=true 
{
  property id;
  function setId(id) {
    variables.id = id & "!";
  }
}

t = new Test(id=123);
writedump(t);

Actual Result:  id is not set, setId function is not invoked at all

Expected Result:  id is set to "123!"

Any Workarounds:

do not count on the broken implicit constructor

Attachments:

Comments:

When this is fixed, please patch it on CF11 and not CF2017, thanks. :)
Comment by Henry H.
1389 | February 01, 2017 08:27:37 PM GMT