From e7de13abe0cfd8f6b27df7c421e6941de7bb9660 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Thu, 7 Apr 2022 16:30:14 +0100 Subject: [PATCH] Backup `file` when moving to CLD only storage --- php/sync/class-storage.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/sync/class-storage.php b/php/sync/class-storage.php index 1cbb1ae54..22592dcbb 100644 --- a/php/sync/class-storage.php +++ b/php/sync/class-storage.php @@ -452,6 +452,7 @@ public function unique_filename( $filename, $ext, $dir ) { public function ensure_metadata( $data, $attachment_id ) { if ( defined( 'REST_REQUEST' ) && true === REST_REQUEST ) { if ( isset( $data['sizes'] ) && 'cld' === $this->media->get_post_meta( $attachment_id, Sync::META_KEYS['storage'], true ) ) { + $data['file'] = path_join( dirname( $data['file'] ), $data['original_image'] ); unset( $data['original_image'] ); } }