SerializeJSON returns only the first two records

I have a problem when serializing an ORM relationship shows only the first two records. The rest just show [] empty.

Here is an example relationship:

property name="endorsements" singularname="endorsement" fieldtype="one-to-many" lazy="false" fkcolumn="xxx" cfc="endorsements" remotingfetch="true"; 

Getting JSON:

 policy = entityLoad("policy",1018379202)[1]; serializeJSON( policy ); 

And the abbreviated part of JSON:

 {"id":12321,"endorsements":[{"effectiveDate":"July, 01 2009 00:00:00","active":true}, {"effectiveDate":"July, 01 2009 00:00:00","active":true}, "","","","","","","","",""]} 

Empty lines should be other entries in the relation.

I checked the debug files that the Hibernate request returns all the records, and cfdump also shows this.

Thoughts?

+6
source share
1 answer

The error occurs in coldfusion.runtime.JSONUtils.serializeJSON () on line 409.

If you serialize a constant cfc, it adds the full name cfc to the ArrayList, which is passed recursively.

Then there is an if () statement that tries to find the full name cfc, and as soon as it appears more than two times in the list, the function starts early using "{}".

Not sure what they tried to execute with if if (). Is it possible to handle circular links?

This error was reported back in April: https://bugbase.adobe.com/index.cfm?event=bug&id=3175667

+4
source

Source: https://habr.com/ru/post/911361/


All Articles