filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
18.98k stars 2.93k forks source link

Rich editor alpine component not recognising uploaded attachments #7144

Closed P-James closed 11 months ago

P-James commented 1 year ago

Package

filament/filament

Package Version

v2.17

Laravel Version

v10.10

Livewire Version

v2.12

PHP Version

PHP 8.2

Problem description

After uploading an image with RichEditor, the alpine component doesn't register the html tag.

The image successfully uploads to S3 (albeit in a livewire-tmp/ directory), but the image is immediately lost upon saving because there is no html markup for it.

HTML is returned as null on the upload response, is this the issue?

CleanShot 2023-07-22 at 13 19 30

CleanShot 2023-07-22 at 13 22 15

Expected behavior

The image should generate some html inside the content of the RichEditor and publish along with the post.

Steps to reproduce

  1. Set Laravel filesystem to S3, make sure buckets are all configured correctly with proper permissions and cors settings.
  2. Create a filament resource with RichEditor component.
  3. Attach / upload an image
  4. Double check the image uploaded successfully in the AWS console
  5. Save resource and refresh page - image doesn't exist

Reproduction repository

https://github.com/P-James/filament-reproduction

Relevant log output

No response

github-actions[bot] commented 1 year ago

Hey @P-James! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.

github-actions[bot] commented 1 year ago

Thank you for providing reproduction steps! Reopening the issue now.

danharrin commented 1 year ago

Can you please check if this is an issue in v3 or not?

rene0399 commented 1 year ago

I can shed some more light here. This is still an issue in V3, but only when fileAttachmentsVisibility is set to public. If the visibility is set to private as in the Doc, it works fine. However the image link is invalid after 5 min, due to the signed URL only has 5 min lifetime.

danharrin commented 11 months ago

Downloaded the reproduction repo, updated to v3 and set up S3:

https://github.com/filamentphp/filament/assets/41773797/7b231012-34ad-42b1-8ae3-080f49eb799b