Make WordPress Core

Opened 17 years ago

Closed 16 years ago

#11455 closed defect (bug) (fixed)

Bulk "Delete Permanently" moves attachments to trash

Reported by: scribu Owned by: nacin
Priority: normal Milestone: 3.0
Component: Media Version: 2.9
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

On the Media editing screen, choosing "Delete Permanently" moves selected attachments to the trash, instead of deleting them.

Attachments (3)

11455-wp_delete_attachment.diff (472 bytes ) - added by nacin 17 years ago.
11455-wp_delete_attachment.2.diff (473 bytes ) - added by nacin 17 years ago.
Typo in patch.
11455-wp_delete_attachment.3.diff (1.3 KB ) - added by nacin 17 years ago.
Also adds MEDIA_TRASH check to wp_trash_post.

Download all attachments as: .zip

Change History (20)

#1 follow-up: @PeteMall
17 years ago

  • Resolutioninvalid
  • Status newclosed

I wasn't able to replicated this. Trash for Media was removed from 2.9 and the "Delete Permanently" action deletes the attachments on my local trunk install.

#2 @nacin
17 years ago

  • Resolution invalid
  • Status closedreopened

I can reproduce. Looking into it.

#3 in reply to: ↑ 1 @nacin
17 years ago

  • Keywords has-patch added

We need to add checks for EMPTY_TRASH_DAYS and MEDIA_TRASH.

#4 @ryan
17 years ago

Shouldn't that still check for !$force_delete rather than $force_delete?

@nacin
17 years ago

Typo in patch.

#5 @nacin
17 years ago

Yep, already repatched.

#6 @automattor
17 years ago

  • Resolutionfixed
  • Status reopenedclosed

(In [12415]) Delete instead of trash when bulk deleting media. Props nacin. fixes #11455

#7 @ryan
17 years ago

We might also want to check MEDIA_TRASH in wp_trash_post() if the type is attachment. This seems good enough for now though.

@nacin
17 years ago

Also adds MEDIA_TRASH check to wp_trash_post.

#8 follow-up: @nacin
17 years ago

  • Resolution fixed
  • Status closedreopened

Patch to add MEDIA_TRASH check to wp_trash_post.

Random thought -- we should add wp_trash_attachment() to 3.0.

#9 in reply to: ↑ 8 @azaozz
17 years ago

  • Milestone 2.93.0

Replying to nacin:

Random thought -- we should add wp_trash_attachment() to 3.0.

Yes, don't really like how wp_trash_post() calls wp_delete_attachment() and wp_delete_attachment() calls back wp_trash_post() in the above patch...

#10 @hakre
17 years ago

Aren't this two tickets? The one is fixed and the additional stuff still opened?

#11 follow-up: @hakre
17 years ago

nacin, I'll close the ticket for now because I hope that will catch your attention. Shouldn't we move the "unfixed"/new part into it's own ticket? (see my last comment)

#12 @hakre
17 years ago

  • Resolutionfixed
  • Status reopenedclosed

#13 @dd32
17 years ago

I'll close the ticket for now because I hope that will catch your attention

Please dont close tickets in order to get someones attention..

#14 in reply to: ↑ 11 @nacin
17 years ago

  • Resolution fixed
  • Status closedreopened

Replying to hakre:

nacin, I'll close the ticket for now because I hope that will catch your attention. Shouldn't we move the "unfixed"/new part into it's own ticket? (see my last comment)

There isn't harm in keeping them as one ticket. There was one part we needed to commit late in 2.9. The rest is directly linked to this but didn't need to go into 2.9, so a core dev moved the milestone to 3.0.

I would consider spinning off the last patch here to a new ticket that also includes wp_trash_attachment(), but wp_trash_attachment() will be addressed after the resolutions of #11470 and #11394, and trash for media.

#15 @nacin
17 years ago

  • Owner set to nacin
  • Status reopenedaccepted

#16 @nacin
16 years ago

  • Milestone 3.03.1

We never got to trash for media in 3.0.

#17 @nacin
16 years ago

  • Milestone Awaiting Triage3.0
  • Resolutionfixed
  • Status acceptedclosed
Note: See TracTickets for help on using tickets.