When an array isn't an array (Coldbox, jQuery, etc)

Notice my two screenshot attachments. The one in which the variable names are in all lowercase is a dump from jQuery (using the jquery.dump.js plug-in that produces cfdump-like dumps). The other one is a cfdump from within CF11, in the Handler method being called by the jQuery $.ajax function.

Note in the first dump, my variable is exactly as it should be… a struct, where one of its keys (lessons) is an array of struct.

However, when it reaches CF, lessons is no longer an array of struct; it’s just a screwy looking fieldname. This is my problem. I’ve never seen this happen before, so I figure it’s either an issue with CF11 or Coldbox 4.

Anybody know how I can fix it? :slight_smile:



Maybe it’s converting into a form struct?

Dump out #getHttpRequestData().content# instead…

Yeah looks like it. But it’s never done that before (for me at least). How can I get it to convert properly, like it used to? It’s useless the way it is now.

Not sure, I’m on Lucee, and I’ve always done:


Are you using the form interceptor?

No interceptor; never used one before. It just worked, many times back with CB3 and earlier versions of CF.

This is the jQuery call that sends it to CF:

$.ajax({ type: “POST”, url: URL, data: data, dataType: ‘json’, success: function(result) (…)

And in the CB4 handler:

var rc = event.getCollection();

var data = StructNew();

var modelObj = getModel(‘instructor’);

data = modelObj.saveDriveData(rc);

event.renderData(type=“json”, data=data);