You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering a TypeError when attempting to upload images with HasMediaPreviewsTrait.
This seems to be related to recent updates either in the PHP version or the Spatie library that enforce stricter type checks.
Error Message:
Spatie\Image\Image::fit(): Argument #1 ($fit) must be of type Spatie\Image\Enums\Fit, string given, called in /vendor/spatie/laravel-medialibrary/src/Conversions/Manipulations.php on line 55
Environment:
Craftable Pro version: 2.0.2
Laravel version: 10.48
PHP version: 8.3.2
Suggested Fix:
The issue arises due to a type mismatch in the fit() method within the autoRegisterPreviews function of the HasMediaPreviewsTrait. The function needs to be updated to use the enum type instead of a string to specify the fit method. Here is the proposed change:
Thank you for considering this change. It would be helpful to check for similar issues to ensure consistent compatibility with the latest library standards.
The text was updated successfully, but these errors were encountered:
Description:
I am encountering a TypeError when attempting to upload images with
HasMediaPreviewsTrait
.This seems to be related to recent updates either in the PHP version or the Spatie library that enforce stricter type checks.
Error Message:
Environment:
Suggested Fix:
The issue arises due to a type mismatch in the
fit()
method within theautoRegisterPreviews
function of theHasMediaPreviewsTrait
. The function needs to be updated to use the enum type instead of a string to specify the fit method. Here is the proposed change:Thank you for considering this change. It would be helpful to check for similar issues to ensure consistent compatibility with the latest library standards.
The text was updated successfully, but these errors were encountered: