[wp-trac] [WordPress Trac] #30167: Restoring an image when IMAGE_EDIT_OVERWRITE is true results in 'Cannot save image metadata.'
WordPress Trac
noreply at wordpress.org
Wed Oct 29 05:19:14 UTC 2014
#30167: Restoring an image when IMAGE_EDIT_OVERWRITE is true results in 'Cannot
save image metadata.'
----------------------------+-----------------------------
Reporter: tiqbiz | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.0
Severity: normal | Keywords:
Focuses: administration |
----------------------------+-----------------------------
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30167>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list