Verify datasource button doesn't work on initial installation


The Verify Datasource button doesn't work on initial installation if you click that you have the datasource already created and enter a datasource name.

Workaround: Select yes, enter the datasource name, and hit enter with the cursor in that field.

This is an issue with the ACF where "Prefix serialized JSON with" is enabled and set to "//", which is a recommendation from the lockdown guide and is a valid configuration.

The solution should be to do a replaceNoCase for both "//{" and "//[" at the start of the JSON string. If that ACF setting is enabled, that will normalize the JSON.


Daniel Garcia
August 1, 2016, 1:22 AM

is there a way in ContentBox when working with JSON to always check and remove the // from the beginning of the string? I found this issue, as well as CONTENTBOX-754, but am wondering where else this might be happening that I just haven't seen yet.

Daniel Garcia
August 1, 2016, 1:13 PM

Thinking more about this, a flexible fix would be to define the serialized JSON prefix in a setting somewhere (maybe default it to "//") and then have a global function that can be called just after the JSON is deserialized to make the JSON usable. If the setting is not enabled, then it will still work. If for some reason the CF admin is using a different prefix (don't know why), it would just be a settings change to make the JSON work better with ContentBox. I did a quick search of the GitHub repo and see 9 places that would be impacted. Doing a search locally, including the ColdBox folder, I see 50 or so.

The quick fix is just to update those 9 places to do a replaceNoCase.

jSONString = replaceNoCase( trim( jSONString ), "//{", "{" );
jSONString = replaceNoCase( trim( jSONString ), "//[", "[" );


// Wherever the delimiter might live, I put it in Application for the purposes of this
jSONString = replaceNoCase( trim( jSONString ), "#Application.JSONDelimiter#{", "{" );
jSONString = replaceNoCase( trim( jSONString ), "#Application.JSONDelimiter#[", "[" );

Brad Wood
August 1, 2016, 3:09 PM

I remember this coming up multiple times in the past. We always just told people to turn off that setting. (I never really understood the usefulness of it anyway). The silly thing is that this really messes with any kind of library authors that want to use ajax since there's no way to detect the setting unless you're using the built-in ajax functions in CF. I thought I had put in a ticket for Adobe to provide some programmatic way to see if that setting was enabled and what it's set to, but I can't find it so I guess it never happened. Ah, here it is-- Pete F had put in the ticket to add a parameter to serializeJSON() to turn off the prefix. Looks like Adobe closed it :/

Luis Majano
August 2, 2016, 3:29 PM

I really can't justify programming around this Adobe specific engine setting like mentiones

Daniel Garcia
August 2, 2016, 3:44 PM

I understand. Would it make any sense to put a check on the initial installer page to test if the JSON is an issue, and if so, display a message letting people know to check that setting? We can also update the documentation. Thanks.

Won't Do


Luis Majano


Daniel Garcia



Affects versions