Opened 11 years ago
Closed 11 years ago
#22215 closed defect (bug) (fixed)
Customizer Custom Background does not set context
Reported by: |
|
Owned by: |
|
---|---|---|---|
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)
Change History (6)
@
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:
↓ 4
@
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
@
11 years ago
- Milestone changed from Awaiting Review to 3.5
- Priority changed from normal to high
#4
in reply to:
↑ 2
@
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 thecontrol.uploader.param
function, which is not defined when that code runs. Using acontrol.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.
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.