Skip to content

Commit 9e6bf61

Browse files
Merge pull request #1034 from cloudinary/fix/system-report-media-sync-size
Ensure the storage is setup when using the size_sync outside of the class
2 parents 433e690 + 0c36e19 commit 9e6bf61

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

php/sync/class-storage.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ public function size_signature( $attachment_id ) {
389389
* @param string $public_id Optional public ID.
390390
*/
391391
public function size_sync( $attachment_id, $public_id = null ) {
392+
if ( empty( $this->media ) ) {
393+
$this->setup();
394+
}
395+
392396
if ( is_null( $public_id ) ) {
393397
$public_id = $this->media->get_public_id( $attachment_id );
394398
}

0 commit comments

Comments
 (0)