-
-
Notifications
You must be signed in to change notification settings - Fork 38
Description
PHP Version
8.4.3
Version
2.0.0
Bug Description
Setting content with SetContent to text 'null' throws an error "Trying to access array offset on null" in vendor\\ueberdosis\\tiptap-php\\src\\Core\\Schema.php:70
Its because in https://github.com/ueberdosis/tiptap-php/blob/2.0.0/src/Editor.php#L45
getContentType is called https://github.com/ueberdosis/tiptap-php/blob/2.0.0/src/Editor.php#L96
and verifies the value using json_decode, but this accepts literal 'null' text as valid null
So in turn apply will get a null document https://github.com/ueberdosis/tiptap-php/blob/2.0.0/src/Core/Schema.php#L70
and throw
Expected Behavior
Be able to edit any text value, including 'null'
Additional Context (Optional)
I only found about this by chance using laravel filament RichEditor that is using this package under the hood.
The input data is external and imported to db, and there was some 'null' text in some of the fields.
Thats why there is also ready to test filament repo with this case as it was reported as filament issue here filamentphp/filament#18216 but closed due the issue being in the package
Dependency Updates
- Yes, I've updated all my dependencies.