[wp-trac] [WordPress Trac] #30394: Multiple edits with IMAGE_EDIT_OVERWRITE define enabled causes deletion of images

WordPress Trac noreply at wordpress.org
Tue Nov 18 19:57:41 UTC 2014


#30394: Multiple edits with IMAGE_EDIT_OVERWRITE define enabled causes deletion of
images
--------------------------+-----------------------------
 Reporter:  hew           |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The ```update_attached_file()``` call in ```wp_save_image()``` (``` wp-
 admin/includes/image-edit.php```) fails when IMAGE_EDIT_OVERWRITE is
 enabled because the underlying ```update_meta_value()``` call has a
 ```meta_value``` (file path) that matches the value already in the DB.

 ```$success = update_attached_file( $post_id, $new_path );```

 The failure there leads to subsequent file deletion at the end of
 ```wp_save_image()```.

 ```@unlink( $delpath );```

 Likely related in some way: #30167

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30394>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list