WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#22750 closed defect (bug) (fixed)

Track and ignore destroyed attachments

Reported by: koopersmith Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: has-patch commit
Focuses: Cc:
PR Number:

Description

Currently, queries can be chained to the point where a destroyed attachment can re-enter the workflow. That is bad.

To test this, go to featured image. Upload an image, then select and delete it. It should disappear.

Attachments (2)

22750.diff (1.1 KB) - added by koopersmith 7 years ago.
22750.2.diff (1.6 KB) - added by koopersmith 7 years ago.

Download all attachments as: .zip

Change History (6)

@koopersmith
7 years ago

#1 @lessbloat
7 years ago

+1 to 22750.diff. Works for me.

@koopersmith
7 years ago

#2 @koopersmith
7 years ago

Account for options.wait, and make wp.media.ajax compatible with old ajax actions (allowing delete-post to actually work).

#3 @nacin
7 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 23057:

Media models: Trac and ignore deleted attachments.

Treat an admin-ajax response of 1 as successful for backwards compatibility with existing handlers.

props koopersmith. fixes #22750.

#4 @nacin
7 years ago

In 23058:

Admin ajax: Roll back new-style error sending in set-post-thumbnail. The JS handlers know to parse an unrecognized response (like -1 or 0) as a failure. see #21776. see #22750.

Note: See TracTickets for help on using tickets.