Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#11145 closed defect (bug) (fixed)

No gallery tab after upload if post hasn't been saved yet

Reported by: yoavf's profile yoavf Owned by:
Milestone: 3.0 Priority: normal
Severity: major Version: 2.8
Component: Gallery Keywords: needs-patch featured
Focuses: Cc:

Description

Uploading a few pictures to an unsaved post fails to load a proper gallery tab:

Steps to reproduce:

  • Create a new post
  • Do not save, do not enter a title
  • Upload a few images
  • Click save changes

You'll get a non functioning gallery tab, like this one:
http://skitch.com/yoavf/n8127/add-new-post-on-off-wordpress

Change History (15)

#1 @scribu
15 years ago

Possibly related: #9471

#2 @johnnytee
15 years ago

I can confirm this being an issue as well in WPMU version 2.8.6

#3 @scribu
15 years ago

  • Milestone changed from Unassigned to 3.0

#4 follow-up: @jeffstieler
15 years ago

  • Cc jeffstieler added

What is the correct course of action to fix this?

I see a few ways of dealing with this:

  1. Autosave just a post ID upon entering the media uploader so there is a valid parent post.
  1. Show a warning to the user upon entering media uploader when there is no post ID, that the media they upload at that point will not have an associated post, and patch get_media_items() to deal with invalid post IDs.
  1. Disallow uploading media to a post without an autosave.

#5 in reply to: ↑ 4 @Denis-de-Bernardy
15 years ago

Replying to jeffstieler:

What is the correct course of action to fix this?

see also #9471

Imo, the correct approach is to immediately assign a uuid to drafts. and since we're now requiring mysql 4.1, we can.

the upload button should then pass the uuid instead of the post_id. and if anything is uploaded we create the post on the fly is no post exists with the same uuid.

#6 @hakre
15 years ago

This has to be confirmed again because I think this ticket is a duplicate of #9471 (#10456).

#7 @hakre
15 years ago

  • Keywords needs-patch added

Reproduced. Buggy behaviour confirmed.

Better hope this time a fix is propper.

#8 @hakre
15 years ago

After doing the test and then looking into #11524 I realized that these images do not even appear in the Media Library, not even unattached. This is getting really esoteric. Others who are willing to reproduce should test if the images do actually exist afterwards in the media library.

#9 @miqrogroove
15 years ago

Tested 2.9.1-RC1.

In a blank post, the image uploader appears normally. I added 5 photos, clicked Save All Changes in the uploader, which then failed to close and looked a lot like OP's screenshot. I then clicked on Save Draft and was sent straight to the Edit Posts screen. Nothing was saved for the post. The 5 images do appear in the Media Library, unattached.

#10 @miqrogroove
15 years ago

  • Milestone changed from 3.0 to 2.9.1
  • Severity changed from normal to major

#11 @miqrogroove
15 years ago

  • Version changed from 2.9 to 2.8

Denis mentioned this was not a 2.9 regression, and I was able to reproduce the same bug in 2.8.4.

#12 @dd32
15 years ago

#10642 (Cant insert image galleries into new posts (same on wordpress.com)) was closed as duplicate of this

#13 @Denis-de-Bernardy
15 years ago

  • Keywords bug-hunt added

#14 @Denis-de-Bernardy
15 years ago

  • Keywords featured added; bug-hunt removed

#15 @markjaquith
15 years ago

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

(In [12987]) Create post_status=auto-draft when creating a new post item. status changes to draft on first auto-save. now we always have a real post ID to work with. see #11889. fixes #11145. fixes #11990

Note: See TracTickets for help on using tickets.