Skip to content

Ensure the storage is setup when using the size_sync outside of the class #1034

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

Merged
merged 1 commit into from
May 19, 2025

Conversation

aatanasov-cloudinary
Copy link
Collaborator

The size_sync method of the storage component is used by other components. For example, when preparing a report, the report might use the size_sync method, which uses other components. If the storage isn't setup, this leads to a PHP fatal error.

Approach

  • Init the setup if $this->media is missing

QA notes

Two options:

  • Use $this->plugin->get_component( 'storage' )->size_sync( $media_id ); outside of the Storage component.
  • Find an attachment without local_size or remote_size, and generate a report. Previously, it caused errors.

@aatanasov-cloudinary aatanasov-cloudinary marked this pull request as ready for review May 19, 2025 08:01
@aatanasov-cloudinary aatanasov-cloudinary merged commit 9e6bf61 into master May 19, 2025
4 checks passed
@aatanasov-cloudinary aatanasov-cloudinary deleted the fix/system-report-media-sync-size branch June 4, 2025 14:47
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