WordPress.org

Make WordPress Core

#22547 closed defect (bug) (fixed)

Thumbnail not shown when uploading a single image in media-new.php

Reported by: scribu Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: has-patch commit dev-reviewed
Focuses: Cc:

Description (last modified by scribu)

Steps to reproduce:

  1. Go to /wp-admin/media-new.php
  2. Upload a single image (let's call it 'test.jpg').

The progress bar shows, the image title is transformed to 'test'; no thumbnail.

  1. Upload another image.

You will now see the thumbnails for both images.

It seems like the code that's supposed to show the thumbnail doesn't get triggered until the second upload.

Reproduced in Firefox and Chrome.

Attachments (2)

22547.diff (906 bytes) - added by duck_ 17 months ago.
22547.css-only.diff (390 bytes) - added by duck_ 17 months ago.

Download all attachments as: .zip

Change History (10)

comment:1 scribu17 months ago

  • Description modified (diff)

duck_17 months ago

comment:2 duck_17 months ago

Introduced by [22755] for #22083.

The problem is that we no longer have a slid out container for the first item showing a thumbnail. So adding the open class when there is only one item is incorrect behaviour now as it hides the pinkynail, but doesn't show the extra information.

attachment:22547.diff is an example patch removing calls to updateMediaForm() in the plupload handlers file.

comment:3 follow-ups: nacin17 months ago

  • Keywords has-patch added

I tried really hard to avoid touching handlers.js in [22755] and related changesets. I did realize that updateMediaForm() had the potential to cause problems, but I thought I had worked around them (and clearly didn't).

The reason is we did a lot of research in the 3.5 cycle for how plugins were using existing code, but we didn't look into handlers.js. That's because we're no longer using handlers.js outside of media-new.php. The new dialog uses the newer, not-terrible Plupload bridge added for the customizer in 3.4. I don't really know how people are using handlers.js — I hope none of them are, but I'd rather leave it alone until 3.6.

Now that I've explained the background, it does look like updateMediaForm() is completely useless for the form, and the side effects of just removing the whole function would be fairly minimal. So this patch is good.

I wouldn't mind a CSS-only patch though.

comment:4 in reply to: ↑ 3 nacin17 months ago

Replying to nacin:

I wouldn't mind a CSS-only patch though.

(That'd be to just remove .media-item.open img.pinkynail in wp-admin.css.)

duck_17 months ago

comment:5 in reply to: ↑ 3 duck_17 months ago

Replying to nacin:

I wouldn't mind a CSS-only patch though.

attachment:22547.css-only.diff

comment:6 ocean9017 months ago

  • Keywords commit added

comment:7 nacin17 months ago

  • Keywords dev-reviewed added

comment:8 nacin17 months ago

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

In 22837:

Media: Remove vestige CSS that prevents thumbnails from always showing on media-new.php. props duck_. fixes #22547.

Note: See TracTickets for help on using tickets.