Has the JSON for renderData changed?

This worked right up to ColdBox 3.0 RC1.

I have some code that is no longer working, and I tracked it back to the renderData as JSON. The following code used to work, which is an Associate Array being returned into users, and then passed onto a JS function.

var errors = pageService.addPage(event);

if(arrayLen(errors)) {

local.result[‘status’] = ‘failed’;

local.result[‘errors’] = errors;

}

event.renderData(type=“JSON”, data=local.result);

However the rendered data via the return request is the name of the object, and not what it should be. The result being returned is as follows.

{“errors”:[{“ValidationError”: “ValidationError”},{“ValidationError”: “ValidationError”},{“ValidationError”: “ValidationError”},{“ValidationError”: “ValidationError”}],“status”:“failed”}

Regards,

Andrew Scott

http://www.andyscott.id.au/

Andrew, I cannot reproduce your error. I get normal json parsing.
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Hmm, this is weird.

Before the renderData I see the structure of errors returned from hyRule. But as soon as I do renderData it changes the data to that as I mentioned earlier.

Are you sure the json stuff hasn’t changed?

Regards,

Andrew Scott

http://www.andyscott.id.au/

Send me a snapshot more to tests if you like, but my tests don’t fail and I get good data on all my apps.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com