[wp-trac] [WordPress Trac] #45075: wp_delete_attachment() has unreliable return and wrong process order

WordPress Trac noreply at wordpress.org
Thu Oct 11 04:48:13 UTC 2018


#45075: wp_delete_attachment() has unreliable return and wrong process order
-------------------------+-------------------------------------------------
 Reporter:  jave.web     |      Owner:  (none)
     Type:  defect       |     Status:  new
  (bug)                  |
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  major        |   Keywords:  attachment delete attachments
  Focuses:               |  thumbnails files
-------------------------+-------------------------------------------------
 When doing permanent deletion, this function should also remove the files
 of the target attachment. However successful return of this function does
 **not** guarantee this even though it still can delete the attachment
 object and its relations.

 Problems when permanent deletion is in process:
 1. {{{wp_delete_attachment()}}} must check for
 {{{wp_delete_attachment_files()}}}'s return and should fail too when
 {{{wp_delete_attachment_files()}}} fails

 2. {{{wp_delete_attachment_files()}}} should be called first - what is the
 point of deleting object and it's relations when physical data could not
 be removed...

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


More information about the wp-trac mailing list