Closed agildehaus closed 7 years ago
Thanks for posting this. I've been encountering this error in a fairly complex project without explicitly storing/retrieving binary data and I haven't been able to diagnose it thus far. I'll try using utf8_encode
.
interesting issue, thanks for reporting
since I have my own company now I have very little time, feel free to issue a patch.
Going to look into this now...
fixed
In Repository::processGroups():
The $current OODBBean can possibly contain binary data if it was retrieved from the database. Mine happens to have Well-Known-Binary from a geometry field.
array_diff calls OODBBean::_toString(). That method attempts to call the model's __toString(), but falls back to json_encode to serialize if the model does not have a __toString().
Unfortunately json_encode can and will fail with binary data. json_encode returns false, which becomes the return value of OODBBean::__toString(), which causes array_diff to throw an exception (see subject).
I'm currently patching this by calling utf8_encode() on each OODBBean property in OODBBean::__toString() before json_encode is called. Seems to work well. Not sure if it's the best solution.