WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#22673 closed defect (bug) (fixed)

QuickPress: Media modal doesn't use the new post id when a post is published

Reported by: ocean90 Owned by: ryan
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: has-patch needs-testing
Focuses: Cc:

Description

  • Upload and insert an image to QuickPress
  • Save/publish the post
  • Open the media modal again
  • Go to the library and select "Uploaded to this post"

It should be empty, but still contains the old image. Also new uploads will be attached to the old post.

Do we have a "render new media modal" method which we can fire on a new QuickPress rendering?

Attachments (2)

22673.diff (10.6 KB) - added by nacin 9 years ago.
22673.2.diff (12.0 KB) - added by koopersmith 9 years ago.

Download all attachments as: .zip

Change History (7)

#1 @nacin
9 years ago

The templates are designed to be post-agnostic on render precisely for situations like this.

So I suppose we need to set media.view.settings.postId on the fly. This value also gets copied over to media.model.

#2 @koopersmith
9 years ago

This isn't going to be enough, we're also going to need to change the corresponding update nonce.

#3 @miqrogroove
9 years ago

Possibly relevant: If you upload an image, abandon the post, and then return to QuickPress later, the same ID and Auto Draft are in play. Then, if you upload an image and save or publish the new draft, it will have two attachments.

@nacin
9 years ago

@koopersmith
9 years ago

#4 @koopersmith
9 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

Patches refresh all of the global post-related JS variables when QuickPress publishes a post, then recreates the modal, and makes sure anything involving post IDs is dynamic.

#5 @ryan
9 years ago

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

In 22994:

In the QuickPress media modal, use the new post id when a post is published.

Props nacin, koopersmith
fixes #22673

Note: See TracTickets for help on using tickets.