Opened 10 years ago
Closed 10 years ago
#30167 closed defect (bug) (fixed)
Restoring an image when IMAGE_EDIT_OVERWRITE is true results in 'Cannot save image metadata.'
Reported by: | tiqbiz | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Media | Keywords: | has-patch |
Focuses: | administration | Cc: |
Description
When restoring an image (after resizing it etc.), if IMAGE_EDIT_OVERWRITE
is set to true then the following condition fails (/wp-admin/includes/image-edit.php, line 622):
if ( !wp_update_attachment_metadata($post_id, $meta) || !update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes) ) {
This is because _wp_attachment_backup_sizes
is already the same as $backup_sizes
(update_post_meta
returns false if there is no update made).
Patch attached, not 100% sure of the coding style though.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Probably related one way or another: #30394