Closed joostvanhoof closed 2 years ago
Actually, if I save an empty EditorJs field the data that's stored in the database is "[object Object]"
so it looks like there is still something wrong with attribute casting and encoding/decoding from array to JSON?
I've seen this on my site too.
It looks like it's double-encoding the JSON for some reason. Might be the cast encoding something that Nova has already encoded.
Does your data look something like this:
""{\"time\":228372095,\"blocks\":[{\"data\":{\"text\":\"Iusto consequatur voluptas itaque minus. Dolorem sunt reiciendis quia rerum ut laborum temporibus.\"},\"type\":\"paragraph\"},],\"version\":\"2.15.0\"}"
Yes:
"{\"time\":1658065712458,\"blocks\":[{\"id\":\"lI-Qi6ysGA\",\"type\":\"paragraph\",\"data\":{\"text\":\"text here\"}}],\"version\":\"2.25.0\"}"
And when saving an empty field:
[object Object]
I can't seem to replicate the [object Object]
error, my empty fields just remain empty, but I've fixed the other issue.
@roelofr thanks for the previous fixes with the attribute casting. After the upgrade however (I'm using the casting now), this is what's happening:
{{ $post->body }}
I getSomething went wrong: Field
blocksis missing
while the database data I can clearly see theblocks
in the stored data.