Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filament Spatie Media Library Plugin] Does not work inside a ManageRelatedRecords page #14031

Open
ryanmortier opened this issue Aug 23, 2024 · 0 comments
Labels
Milestone

Comments

@ryanmortier
Copy link

ryanmortier commented Aug 23, 2024

Package

filament/spatie-laravel-media-library-plugin

Package Version

v3.2.107

Laravel Version

v11.21.0

Livewire Version

v3.5.6

PHP Version

PHP 8.2

Problem description

The spatie media library plugin form component doesn't seem to work inside a ManageRelatedRecords page.

Some more discussion in Discord: https://discord.com/channels/883083792112300104/1275874487476289577

Trying to save an uploaded file results in the following SQL error:

SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: media.collection_name (Connection: sqlite, SQL: insert into "media" ("model_id", "model_type", "uuid", "order_column", "updated_at", "created_at") values (1, App\Models\User, 961bb9f2-b1bb-4a64-9ca0-2fd84b3087f1, 1, 2024-08-23 02:14:05, 2024-08-23 02:14:05))

In the reproduction repo I've included two subresources, one is files which uses the default FileUpload form component and works great. The second is media which uses the spatie media library plugin and does not work.

I'm not sure how to debug this anymore.

Expected behavior

Would expect it to create the media in the spatie media library table and also save the files to disk.

Steps to reproduce

  1. Clone reproduction repo, install and migrate (sqlite database)
  2. Navigate to /admin
  3. Login as test@example.com / password
  4. Click the user resource
  5. Click on the first user to open sub navigation
  6. Click the media subresource
  7. Try to add a file and observe error

Reproduction repository (issue will be closed if this is not valid)

https://github.com/ryanmortier/filament-issues

Relevant log output

No response

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
@zepfietje zepfietje added this to the v3 milestone Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants