ERP5Form: new gadget boolean option to serialize value to JSON
We have started to use Gadget fields in a project and for most of them, we have to exchange more than 1 text value with the client part. Currently, our TALES expressions are polluted with
JSON.parse calls on client side.
But the most important change in this commit is that it encourages to use proper serialization when needed (it's a common trap to do quick&dirty serialization, for example by joining/splitting with a particular char).
It's a small change and I doubt there would be a choice than JSON here.
This merge request contains merge conflicts
To merge this request, resolve these conflicts or ask someone with write access to this repository to merge it locally.
I also feel the json serialisation could be done automatically, not only when setting the value from server to gadget, but also during form validation. Gadget's
Does it need to be a GadgetField option ? can't we just always use json to encode / decode ? ( maybe unless gadget is set to use "Data Url" )