awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.
MIT License
290 stars 79 forks source link

Call to a member function getGridLayouts() on null #227

Closed ioson closed 10 months ago

ioson commented 10 months ago

Filament Version

v3.1.8

Plugin Version

^v3.1.10

PHP Version

PHP 8.2.13

Problem description

Im getting this error when using TipTap Editor in a form: Call to a member function getGridLayouts() on null

It's caused by the v3.1.10 Update.

This file causes the error: resources/views/components/tools/grid.blade.php Link to file

Expected behavior

Not getting an error.

Steps to reproduce

Update filament-tiptap-editor to version v3.1.10 or higher. Use the Editor in a form.

Reproduction repository

No response

Relevant log output

No response

awcodes commented 10 months ago

Have you published the views by any chance? I don't see how $editor can be null.

tonypartridger commented 10 months ago

Confirm an issue @awcodes as a fatal error solution we can use:

    $layouts = $editor ? $editor->getGridLayouts() : []

I'm trying to drill down the root cause, I suspect its when the grid layout isn't being used within the profile.

ioson commented 10 months ago

Have you published the views by any chance? I don't see how $editor can be null.

No, i don't have published vendor views in resources/views.

I tried changing the editor config, but it doesn't help.

Will take a look at it again.

ioson commented 10 months ago

Ok i found that changig the 'floating_menu_tools' config actually hepls: My current config had the value 'grid' in it. When i remove it, it works.

Old config entry: 'floating_menu_tools' => ['media', 'grid', 'grid-builder', 'details', 'table', 'oembed', 'code-block']

Current and default repository config: 'floating_menu_tools' => ['media', 'grid-builder', 'details', 'table', 'oembed', 'code-block', 'blocks']

I don't remember ever changing the config. But i published it.

awcodes commented 10 months ago

Still could be a bug though thanks for digging.

awcodes commented 10 months ago

This should be resolved with latest release. Thanks again.