WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 months ago

#16164 closed defect (bug) (duplicate)

"You are not allowed to delete this post." - While Deleting a Media Library Item

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Media Keywords: has-patch dev-feedback
Focuses: Cc:

Description

While deleteing 999 media library items, the request timed out. Resending the same request triggered an error message:

You are not allowed to delete this post.

For me as a programmer, I know that those library items are technically a post, but for communicating with the user, the error message is misleading.

Attachments (1)

16164.diff (470 bytes) - added by solarissmoke 3 years ago.
Don't fall over when trying to delete a non-existent media item

Download all attachments as: .zip

Change History (10)

comment:1 hakre3 years ago

Related: #16162

comment:2 hakre3 years ago

Somewhat related: If you delete a bunch of media items of which some have been already deleted by some other thread, it will stop at the first one that is not able to delete (e.g. because it already has been deleted).

As the request was to delete a post, it could be considered successfull if that post had been already deleted. So it's possible worth to just skip (or count the number of successful deletions) and try further instead of stopping.

This might especially make sense if multiple users are making use of the backend and do some clean-up work. To more gracefully deal with (already) non-existant posts while deleting.

comment:3 mikeschinkel3 years ago

  • Cc mikeschinkel@… added

comment:4 nacin3 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

As the request was to delete a post, it could be considered successfull if that post had been already deleted. So it's possible worth to just skip (or count the number of successful deletions) and try further instead of stopping.

Seems fine.

solarissmoke3 years ago

Don't fall over when trying to delete a non-existent media item

comment:5 solarissmoke3 years ago

  • Keywords has-patch dev-feedback added; needs-patch removed

comment:6 solarissmoke3 years ago

Actually, see the patch on #16165 which includes this as well as other improvements to bulk handling.

comment:7 bpetty22 months ago

I have posted an updated patch on #16165, which like the previous comment, includes a fix for this ticket as well.

comment:8 bpetty22 months ago

  • Cc bpetty added

comment:9 nacin3 months ago

  • Component changed from General to Media
  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #16165.

Note: See TracTickets for help on using tickets.