Make WordPress Core

Opened 9 years ago

Last modified 3 years ago

#33713 new defect (bug)

Customizer: allowing to set files other than image for Header background and background image

Reported by: umeshnevase's profile umesh.nevase Owned by:
Milestone: Future Release Priority: normal
Severity: major Version: 4.3
Component: Media Keywords: needs-patch
Focuses: ui, javascript Cc:


When we set header background image or background image from customizer settings, media upload should not allow to upload files other than image.

We can set files other than image, and it shows broken in preview

Attachments (1)

big-fix.33713.diff (2.0 KB) - added by jagnew 8 years ago.
Possible solution

Download all attachments as: .zip

Change History (11)

#1 @umesh.nevase
9 years ago

  • Component changed from General to Administration
  • Keywords needs-patch dev-feedback added
  • Severity changed from normal to major

#2 @umesh.nevase
9 years ago

  • Keywords dev-feedback removed

#3 @umesh.nevase
9 years ago

  • Component changed from Administration to Customize
  • Focuses accessibility added

#4 @afercia
9 years ago

  • Focuses accessibility removed

Thanks @umesh.nevase, just reproduced on trunk, followed steps:

Customizer > Header Image > Add new image > uploaded a .txt file in the "drop zone"

the .txt file is uploaded and I'm given the ability to "select and crop" it :)

Pressing the "Select and Crop" button brings me to the "Crop Image" view which shows a broken image placeholder. No error messages in the console.

Removing the "accssibility" keyword, definitely something worth having a look at though. cc @wonderboymusic

8 years ago

Possible solution

#5 @jagnew
8 years ago

Possible solution. However, there is two areas that could be improved:

1) Having to set the filter in both two places in the customize-controls.js
2) Hardcoding the image type extensions

Anyway first time contributing, so always up for learning. Thanks :)

#6 @celloexpressions
8 years ago

This should probably be addressed more generically in the media component. Essentially the issue is that if the context of the library is set to a specific mime type, the uploader should also restrict accordingly, or there should otherwise be some error reporting.

#7 @celloexpressions
8 years ago

#33415 was marked as a duplicate.

#8 @ocean90
8 years ago

  • Milestone changed from Awaiting Review to Future Release

Previously: #22149

#9 @ocean90
8 years ago

#36844 was marked as a duplicate.

#10 @celloexpressions
3 years ago

  • Component changed from Customize to Media
  • Milestone set to Future Release

Moving to media component for visibility, as the customizer uses the same media modal used elsewhere in core for this UI. If/when the media modal supports restricting uploads by file type, then the customize media controls can map their mime_type parameters to the media JS accordingly. This may already be possible and not implemented correctly in the customize controls.

Note: See TracTickets for help on using tickets.