tracker issue : CF-4095369

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

NULL values are handled differently by serializeJSON() for ORM entities

| View in Tracker

Status/Resolution/Reason: To Fix//

Reporter/Name(from Bugbase): Mingo Hagen / Mingo Hagen (Mingo Hagen)

Created: 12/03/2015

Components: Language

Versions: 11.0

Failure Type: Unspecified

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Trivial / Unknown

Locale/System: ALL / Platforms All

Vote Count: 6

Problem Description:

Using serializeJSON() to convert an object to json gives a different result than when using serializeJSON() to convert a struct to json when it encounters a NULL value.


Steps to Reproduce:

    var asStruct = {
      "nullField" = javaCast( "null", 0 )
    };

    var asEntity = entityNew( "objectWithNull", asStruct );

    writeOutput( serializeJSON( asStruct ) & "<br>" );
    writeOutput( serializeJSON( asEntity ) & "<br>" );


Actual Result:

{"nullField":null}
{}


Expected Result:

{"nullField":null}
{"nullField":null}

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4095369

External Customer Info:
External Company:  
External Customer Name: Mingo Hagen
External Customer Email:  
External Test Config: My Hardware and Environment details:



Windows / CF11

Attachments:

  1. December 03, 2015 00:00:00: 1_null-inconsistency.zip

Comments:

+1234567890123456789012345
Vote by External U.
5157 | December 03, 2015 08:08:47 AM GMT
+1 .....................................
Vote by External U.
5158 | December 03, 2015 04:10:49 PM GMT
This just bit us. The inconsistency is the biggest issue here. If ACF is going to simply ignore NULLs for returning into JSON, then it should do it for both returning structures and entities.
Vote by External U.
5159 | December 04, 2015 03:43:40 AM GMT
+ Eleventy Billion.
Vote by External U.
5160 | December 21, 2015 07:08:15 PM GMT
oh please please please be consistent. discovering inconsistencies costs everyone who uses this product a nonzero amount of time and money.
Vote by External U.
5161 | December 21, 2015 07:36:13 PM GMT
+1 for C-O-N-S-I-S-T-E-N-C-Y.
Vote by External U.
5162 | December 21, 2015 09:17:17 PM GMT