awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Call to a member function getGridLayouts() on null

ioson opened this issue · comments

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

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

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.

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.

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.

Still could be a bug though thanks for digging.

This should be resolved with latest release. Thanks again.