Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Ben Ferdinandus
Ben FerdinandusPriority
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Created 23 July 2021 at 11:09
Updated 1 June 2022 at 07:40
If I create an component with a few numeric properties, and for one of those properties i write a custom getter, then serializeJSON does not pick up on that.
Example code:
Test.cfc
component accessors=true { property name="number1" type=numeric getter="false"; property name="number2" type=numeric; property name="sum" type=numeric; public numeric function getSum() { return variables.number1 + variables.number2; } }
index.cfm
<cfscript> run(); function run() { var oTest = new Test(); oTest.setNumber1(10); oTest.setNumber2(20); writeDump(oTest); writeDump(serializeJSON(oTest)); } </cfscript>
In lucee 5.3.8+189 this results in the json output {"number1":10,"number2":20}
In adobe 2018.0.11+326016 this results in the json output {"number2":20,"sum":30.0}