Closed eisler closed 11 months ago
Feel free to PR a fix for this!
@eisler Hi! Looks like, you/someone else have changed this file manually. Please, check it.
Why do I think so? See https://github.com/spatie/laravel-medialibrary/blob/10.7.10/src/Conversions/ConversionCollection.php#L63 (your package version source)
$model
variable defined always - without any conditions65▕ if ($model->registerMediaConversionsUsingModelInstance && $media->model) {
is on line 65, but in original repository this condition in line 63Upgrading spatie/laravel-medialibrary (10.7.10 => 10.11.3)
I apologize for the incorrect version mentioned in the initial bug report. The correct version where this issue occurred is 10.11.3.
This is already fixed in 10.11.4
Bug Report
Summary:
When running the
php artisan media-library:clean --dry-run
command in a production environment, an error occurs due to an undefined variable$model
. This error prevents the command from executing successfully.Steps to Reproduce:
Expected Results:
The
media-library:clean
command should run in dry-run mode without errors and provide a summary of the media files that would be deleted without actually deleting them.Actual Results:
An
ErrorException
occurs with the message "Undefined variable $model" as shown below:Additional Information: