WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 13 months ago

Last modified 13 months ago

#19730 closed defect (bug) (fixed)

"Add Media" link directs to error page after permanently deleting a media item

Reported by: Jordi-Fun Owned by:
Milestone: 3.5 Priority: normal
Severity: minor Version: 3.3
Component: Media Keywords: has-patch
Focuses: Cc:

Description

After deleting a media item permanently and try to directly add a new one via the 'title-menu-link' (the button-link near the "Media" title in the admin screen) will result in a death link ("Invalid post type").

Follow these steps to reproduce the death link(s):

If you have no unattachted media in your library, first do this:

  • Media > Add New
  • From the 'title' menu "Add New" (Button near "Media Library" at the top)
  • Add a random image/file and press "Save changes"
  • You'll get redirected back to the overview of all your media.

If you already have one or more unattached media items in the library:

  • Click on the "Delete Permanently" link of the file you just uploaded (the unattached file) (and press oke in the alert dialog)
  • This is where something goes wrong: You'r now redirected to the edit.php page where you can read: "Item permanently deleted.". Now click again on the "Add New" link in the title-menu near the title "Media"
  • You're now redirected to an invalid page: "Invalid post type".

Attachments (1)

19730.patch (4.2 KB) - added by SergeyBiryukov 4 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 in reply to: ↑ description ; follow-up: @linuxologos4 years ago

Replying to Jordi-Fun:

  • This is where something goes wrong: You'r now redirected to the edit.php page where you can read: "Item permanently deleted.". Now click again on the "Add New" link in the title-menu near the title "Media"

Is this a clean install? I'm being redirected to upload.php, not edit.php, and the message I get is "Media attachment permanently deleted.".

comment:2 in reply to: ↑ 1 @Jordi-Fun4 years ago

Replying to linuxologos:

Replying to Jordi-Fun:

  • This is where something goes wrong: You'r now redirected to the edit.php page where you can read: "Item permanently deleted.". Now click again on the "Add New" link in the title-menu near the title "Media"

Is this a clean install? I'm being redirected to upload.php, not edit.php, and the message I get is "Media attachment permanently deleted.".

I will try again with a clean install. I found this bug a few weeks ago when it was a clean install, but in the meantime I've installed some themes and pluguins and upgraded to the latest version.

Checked again, and I left 1 plugin active, but also deactivated I still have this issue. I'll test it out as soon as possible with a clean install.

Last edited 4 years ago by Jordi-Fun (previous) (diff)

comment:3 @Jordi-Fun4 years ago

I was able to reproduce this bug again on a clean (3.3.1) install. If needed I can provide access to my (clean - 3.3.1) wordpress install.

Last edited 4 years ago by Jordi-Fun (previous) (diff)

comment:4 @SergeyBiryukov4 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.4

I can reproduce with referers disabled. The page that says "Invalid post type" is post-new.php?post_type=attachment.

Adding _wp_http_referer to delete links in _get_row_actions() (similarly to WP_MS_Users_List_Table) fixes this.

The patch also improves readability a bit.

@SergeyBiryukov4 years ago

comment:5 @ryan3 years ago

  • Keywords early added
  • Milestone changed from 3.4 to Future Release

comment:6 @ericlewis14 months ago

Can not reproduce. @SergeyBiryukov or @Jordi-Fun, can you still? If so, more specific steps to reproduce (or even a video) appreciated :D

Last edited 14 months ago by ericlewis (previous) (diff)

comment:7 @ericlewis14 months ago

  • Keywords reporter-feedback added

comment:8 @ericlewis14 months ago

  • Summary changed from Death "Add Media" link after permanently deleting media items. to "Add Media" link directs to error page after permanently deleting a media item

comment:9 @wonderboymusic13 months ago

  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

This sounds like pre-3.5 - seems like we can safely close, as it is not reproducible

comment:10 @SergeyBiryukov13 months ago

  • Keywords early reporter-feedback removed
  • Milestone set to 3.5
  • Resolution changed from worksforme to fixed

Fixed in [21948] and [22777].

Last edited 13 months ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.