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

Allow to clean orphaned media when the registerMediaConversionsUsingModelInstance property is set to true on the model #3120

Merged

Conversation

tomcoonen
Copy link
Contributor

This is a fix for the media-library:clean command.

Without the check if the model exists, the $model->mediaConversions = [] would fail because $model would be null.

When $model->registerMediaConversionsUsingModelInstance is false, the $media->model check will not execute and not result in an extra query.

…ModelInstance` property is set to `true` on the model.
@freekmurze freekmurze merged commit 94803ea into spatie:main Dec 6, 2022
@freekmurze
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants