Where did you use the toJSON() formatter? Did you use it to parse a JSON string or is it for the value returned from a JSON field in the database. The JSON database field should not need to be parsed, there were some databases where this didn’t happen and that should now have been fixed. When you insert into a database JSON field you can just use the array/object directly and reading the data should return the array/object again. This worked on most databases correctly and the last update fixed this behavior for the databases not parsing it correctly.
In SC I query the JSON field from database and output with a Set Value = query.config_value.parseJSON()
Then in UI I use this to show the same JSON field in a modal but pretty with format using a “JSON.stringify” with the help of this tiny script:
<script>
function prettyPrint() {
var ugly = document.getElementById('json_full').value;
var obj = JSON.parse(ugly);
var pretty = JSON.stringify(obj, undefined, 4);
document.getElementById('json_full').value = pretty;
}
</script>
Now in this new version I see that this is not neccesary any more because the field is now parsing without declare parseJSON().
But my question now is if this will be permanent or will change in next version.
Right now I downgrade the files from new version to keep things like before, but if this will keep permanent I could upgrade without worry about it again.
This change will be permanent, as I mentioned it was already default for most databases and the correct behavior, I believe only mySQL on NodeJS didn’t return the JSON fields correctly, this has now been fixed.