Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#22215 closed defect (bug) (fixed)

Customizer Custom Background does not set context

Reported by: kovshenin's profile kovshenin Owned by: nacin's profile nacin
Milestone: 3.5 Priority: high
Severity: normal Version: 3.4
Component: Customize Keywords: has-patch commit
Focuses: Cc:

Description

Steps to reproduce:

  • Activate a theme with Custom Background support
  • Fire up the Customizer and upload a new background image, save changes.
  • Browse to the Media Library and find your new image

Expected context is "Background Image" but no context shows up. This bug also prevents background images uploaded through the Customizer to show up in its own Uploaded tab. It looks like the context is not being passed to ajax-actions.php by customize-controls.js.

Attachments (1)

22215.diff (1012 bytes) - added by kovshenin 11 years ago.
Uses a control.uploader.params object to set the context and theme, which is then passed to the Uploader.

Download all attachments as: .zip

Change History (6)

#1 @kovshenin
11 years ago

  • Version changed from 3.4.2 to 3.4

Confirmed this has been broken since 3.4 for Custom Background. However, Custom Header did pass the context on upload in 3.4, but the Custom Header upload functionality was removed from the Customizer in 3.4.2.

@kovshenin
11 years ago

Uses a control.uploader.params object to set the context and theme, which is then passed to the Uploader.

#2 follow-up: @kovshenin
11 years ago

  • Keywords has-patch added

In 22215.diff removing the use of this.uploader.supported which apparently is empty at that stage, and not using the control.uploader.param function, which is not defined when that code runs. Using a control.uploader.params object directly which is passed to the Uploader when it's created. Not entirely sure this is the right approach to solve this, feedback appreciated.

#3 @nacin
11 years ago

  • Milestone changed from Awaiting Review to 3.5
  • Priority changed from normal to high

#4 in reply to: ↑ 2 @koopersmith
11 years ago

  • Keywords commit added

+1

Replying to kovshenin:

In 22215.diff removing the use of this.uploader.supported which apparently is empty at that stage, and not using the control.uploader.param function, which is not defined when that code runs. Using a control.uploader.params object directly which is passed to the Uploader when it's created. Not entirely sure this is the right approach to solve this, feedback appreciated.

This is exactly the right approach to solve this. Since the wp.Uploader instance is created right after this code runs, we should use the params key (which you correctly did) instead of trying to use the wp.Uploader methods.

#5 @nacin
11 years ago

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

In 22484:

Properly set upload context when uploading a background image through the customizer. props kovshenin. fixes #22215.

Note: See TracTickets for help on using tickets.