Closed joostvanhoof closed 2 years ago
I still can't replicate this issue. Are you using the editor in a conditional field or something?
I am also getting [Object object] saved in my database with 3.0.4 when updating an entry without changing the editorJs field's content.
This only happens when casting the attribute. I have the following in my model:
protected $casts = [
"description" => NovaEditorJsCast::class,
];
If I remove this the problem goes away.
@roelofr this bug is still there for me, for you as well @johnpuddephatt? There is this commit suggested which I think should fix it?
@roelofr this bug is still there for me. If I don't change the content (because I've edited other fields) and then update the resource I still get the error message indicating it tries to save [object Object]
as a value in the database.
@roelofr this bug is still there for me, for you as well @johnpuddephatt?
Yes it's still there in 3.0.5 when I cast the field content with Advoor\NovaEditorJs\NovaEditorJsCast. Without the casting it does not occur.
But can you easily cast the stored data to HTML without the cast?
The mixture of HTML and JSON is supposed to be solved by the cast.
@roelofr this might be related to this issue because it's trying to save [object Object] again.
What's happening is that when I have an empty EditorJS field in Nova and type some content and save it, everything works fine.
If I then edit the resource and hit save but don't edit the content, I get:
If I change the EditorJS content and save it (even if it's just adding a dot), then it does actually works.