Call to a member function getAttributeValue() on null Using Spatie Media & Translatable Plugins

when added Media & Translatable Plugins in the Resource i get error when try to upload and save the image
Call to a member function getAttributeValue() on null
Call to a member function getAttributeValue() on null
18 Replies
Dennis Koch
Dennis Koch16mo ago
Share some code and the error url. Please read #✅┊rules
omegar0643
omegar0643OP16mo ago
Here is my code @Dennis Koch https://github.com/PterodactylStore/filament-test Look at PostResource
GitHub
GitHub - PterodactylStore/filament-test
Contribute to PterodactylStore/filament-test development by creating an account on GitHub.
omegar0643
omegar0643OP16mo ago
Any solution?
Dennis Koch
Dennis Koch16mo ago
Hm. I don’t know sorry
awcodes
awcodes16mo ago
Can you share the flare url?
omegar0643
omegar0643OP16mo ago
What's flare url
omegar0643
omegar0643OP16mo ago
GitHub
Call to a member function getAttributeValue() on null Using Spatie ...
Package filament/spatie-laravel-media-library-plugin Package Version v3.0.27 Laravel Version v10.18.0 Livewire Version v3.0.0-beta.9 PHP Version PHP 8.2.8 Problem description Recording.2023-08-20.0...
Dennis Koch
Dennis Koch16mo ago
Flare is Laravels error screen and you can hit the share button there. See #✅┊rules
omegar0643
omegar0643OP16mo ago
Flare
Call to a member function getAttributeValue() on null - The error occurred at http://127.0.0.1:8001/admin/posts/1/edit
omegar0643
omegar0643OP16mo ago
Help?
awcodes
awcodes16mo ago
For some reason the media object is null like it’s not getting attached to the record. Did you follow all the steps for spatie media library itself (not the plugin) to setup your model?
omegar0643
omegar0643OP16mo ago
Yes I think because I'm using spatie translatable I try without translatable plugin and it's work And this error appear only if I use spatie media library and translatable both in same resource I have also included my repo that reproduce the error
omegar0643
omegar0643OP16mo ago
https://github.com/PterodactylStore/filament-test/blob/main/app/Models/Post.php The post model is correct following the docs for both packages
GitHub
filament-test/app/Models/Post.php at main · PterodactylStore/filame...
Contribute to PterodactylStore/filament-test development by creating an account on GitHub.
omegar0643
omegar0643OP16mo ago
any idea how i can combine both spatie plugins without the mentioned error ?
awcodes
awcodes16mo ago
I honestly don’t know. I’d recommend reaching out on one of the Spatie packages repos to see what they recommend for having them work together.
omegar0643
omegar0643OP16mo ago
I have already try to add image manually to database for each translatable post and display the post with images And is works So the problem filament plugin can't Handel adding the media image to database when translatable plugin is enabled
awcodes
awcodes16mo ago
There is a bug in the Translatable Plugin. You can follow it at https://github.com/filamentphp/filament/issues/7591
GitHub
Translatable resource with media bug · Issue #7591 · filamentphp/fi...
Package filament/spatie-laravel-translatable-plugin Package Version v3.0.13 Laravel Version v10.18.0 Livewire Version v3.0.0-beta.8 PHP Version PHP 8.2.8 Problem description Editing translatable re...
omegar0643
omegar0643OP16mo ago
Okay thank you 👍
Want results from more Discord servers?
Add your server