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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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