Closed adetwiler closed 12 years ago
A datasource will save if arrays are used in array schema types.
A model will not save if an object is passed in lieu of an array.
I don't really consider this a bug. The schema field type is array, not object. Javascript (and JSON) don't really make a distinction between hash arrays, typed and untyped objects. PHP does. Because of this, JSON-stored data can only be decoded into one form--array or stdClass--and there's no way to tell which would be "correct" in terms of the pre-encoded data.
Edit: There is an incoming bugfix which will decode arrays as arrays properly, not as stdClass objects. With that in mind, I think it's reasonable to only accept arrays on save, since you will only ever get arrays on load.
Datasources won't save if "array" schema types are used.