statikbe / laravel-filament-flexible-content-blocks

The Laravel Filament Flexible Content Blocks package helps you to easily create content in Filament for any model, with predefined or custom blocks, and foreach block an extendable Blade view component.
MIT License
115 stars 18 forks source link

Saving an image in an image block causes an error #31

Closed scottjo closed 6 months ago

scottjo commented 8 months ago

Been using the flexible content successfully for a while. Thanks. However, I have updated herd, composer update to the latest versions of Filament etc. and now when I try to save an uploaded image to a block I get a problem.

I am able to upload an image. Image loads successfully and I get the green top border. I click save to save my blocks and I get the following:

Filament\Forms\Components\BaseFileUpload::Filament\Forms\Components{closure}(): Argument #2 ($value) must be of type array, Livewire\Features\SupportFileUploads\TemporaryUploadedFile given

And it crashes and burns!

Version numbers that I am using "laravel/framework": 10.43 "filament/filament": 3.2.25 "spatie/laravel-medialibrary": 10.15 "statikbe/laravel-filament-flexible-content-blocks": 0.2.12

Any ideas?

sten commented 8 months ago

@scottjo I am afraid it is a known bug. I am working on a fix. Please for now use v0.2.9.

Filament changed its logic with regard to the translatable resource pages and the media library field no longer returns the UUID of the media record. So I plan to use the custom_properties of the media table to store the block uuid. The only problem is that I will probably need to update the JSON data of the content_blocks field. I am still hoping to avoid a data transformation step.

scottjo commented 8 months ago

Sten, Thank you so much for coming back to me - I can confirm that fixing the flexible block release to 0.2.9 has done the trick. Keep up the good work - great package!

vonec commented 7 months ago

this is a fresh empty set with laravel 11 what am i missing ... does this needs to be upgraded to laravel 11 ?

Problem 1

vonec commented 7 months ago

please let me know how i can help you in this ... i really liked this plugin ... this is a gem of a plugin which will be widely adopted

sten commented 7 months ago

@vonec Currently Laravel 11 is not supported. I have tried to upgrade, but the problem is the medialibrary dependency. The latest version of medialibrary depends on spatie-image and the latest version of that lib has changed its api for image conversions completely. So I need to rewrite the image conversion logic to adapt to this new api.

It is one of the next items on my TODO list. First is releasing a fix for the block images. I almost there.

Of course a PR is always welcome!

sten commented 7 months ago

@scottjo I just released v1.0.0. This should solve your image troubles.

scottjo commented 6 months ago

@sten - thanks very much - I'll upgrade when I'm back in front of my dev machine. Thanks again