WordPress.org

Make WordPress Core

Opened 17 months ago

Last modified 5 months ago

#39625 new defect (bug)

Give an error message when a non-image is uploaded for featured image

Reported by: karmatosed Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords: ux-feedback
Focuses: Cc:

Description

I was able to upload a video but it didn't error, it just didn't show. I feel we should give some feedback that this isn't supported. Yes, it doesn't add the video but it shouldn't just reshow the 'add' call. This is what you see after having seemingly gone through upload working - the video shows in media browser.

https://cldup.com/272Cq89Sl0.png

Change History (7)

#1 @karmatosed
17 months ago

  • Component changed from General to Media
  • Keywords ux-feedback added

#2 @Presskopp
17 months ago

Forgive me, ICNR: I was able to insert a salami in my drive, but it didn't error, it just didn't play. I feel we should give some feedback that this isn't supported. Yes, it doesn't play the salami but it shouldn't just reshow the 'Insert CD' call. This is what you see after having seemingly gone through mounting working - the salami is mounted as empty disc.

It reads a bit like that because it demands an image, and no video or pdf or mp3. We now could

1) not let the user upload non-image files here at all 2) let them upload whatever is allowed, but give a warning "Filetype not supported, please upload a valid image file - your file has been uploaded anyway and you will find it in the media library, but you still don't have a featured image" 3) open up this function to allow videos as 'featured media' if a theme would allow such 4) leave it as it is

#3 @lukecavanagh
17 months ago

@Presskopp

Option two seems like the most valid one to go with.

#4 @westonruter
14 months ago

I think option 1 is correct. There seems to be a deficiency in the uploader whereby the MIME type passed into the media library is not also being passed along to the uploader. The uploader seems like it should be restricting the file types.

See related issue in media widgets: https://github.com/xwp/wp-core-media-widgets/issues/128

#5 @westonruter
14 months ago

I can see the full list of MIME types when I look at wp.media.frame.uploader.uploader.uploader.settings.filters.mime_types. I'm not sure how to properly override it, however.

I'm not the only one to ask the question: http://stackoverflow.com/questions/38400352/plupload-change-mime-type-filter-after-init

Looks like there is a bug in Plupload affecting the ability to change the file filter after init: https://github.com/moxiecode/plupload/issues/1339

#6 in reply to: ↑ description @SergeyBiryukov
7 months ago

  • Summary changed from Give an error message when a video is uploaded for featured image to Give an error message when a non-image is uploaded for featured image

Replying to karmatosed:

I was able to upload a video but it didn't error, it just didn't show.

Confirmed, the same happens when uploading a PDF, ZIP, or any other non-image file.

Note: See TracTickets for help on using tickets.