WordPress.org

Make WordPress Core

#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 17 months ago.
22673.2.diff (12.0 KB) - added by koopersmith 17 months ago.

Download all attachments as: .zip

Change History (7)

comment:1 nacin17 months 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.

comment:2 koopersmith17 months ago

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

comment:3 miqrogroove17 months 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.

nacin17 months ago

koopersmith17 months ago

comment:4 koopersmith17 months 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.

comment:5 ryan17 months 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.