WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#30125 closed defect (bug) (fixed)

Twenty Fifteen: Default colors in controls don't update with color scheme.

Reported by: iamtakashi Owned by: johnbillion
Milestone: 4.1 Priority: normal
Severity: normal Version: 4.1
Component: Customize Keywords: has-patch
Focuses: Cc:

Description

This also started from the last few days so it's likely due to recent changes in Customizer.

  • Header Text Color doesn't update its default color with color scheme.
  • Background Color doesn't update its default color with color scheme.

Further more,
Both Header & Sidebar Background color and Sidebar Text Color will be broken with the follwoing steps.

  1. Change color of Header & Sidebar Background color to red for example.
  2. Save
  3. Reload Customizer.
  4. Click default for the control, Header & Sidebar Background color.

You will get / instead of a default color.

https://cldup.com/3GiQ0ByvTS.png

Related: [30014] #29572 #29980

Attachments (1)

30125.patch (1.1 KB) - added by antpb 5 years ago.

Download all attachments as: .zip

Change History (9)

#1 @celloexpressions
5 years ago

  • Component changed from Bundled Theme to Customize
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.1

We probably need to make some adjustments to the color control, which was recently refactored to leverage JS templates. More likely a core issue, although Twenty Fifteen may have been doing it wrong, in which case we'll pass this back to bundled theme.

This ticket was mentioned in Slack in #core-themes by iamtakashi. View the logs.


5 years ago

#3 @antpb
5 years ago

Noticing that if you set it to a different color scheme and back to default it does not produce the error. It's on the initial setting of the default scheme on customizer page load.

#4 @antpb
5 years ago

  • Keywords has-patch added; needs-patch removed

Worked with Johnbillion on this one. Found that the data.defaultValue if statement did not have an else statment in
class-wp-customize-control.php

				else { 
					defaultValue = data.defaultValue;
				}

@antpb
5 years ago

#5 @antpb
5 years ago

Patch uploaded. Thanks johnbillion!

#6 @johnbillion
5 years ago

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

In 30087:

Correct some logic to populate the defaultValue variable when data.defaultValue begins with a hash symbol.

Props antpb
Fixes #30125

#7 follow-up: @iamtakashi
5 years ago

The second part of the issue has been fixed but Header Text Color and Background Color still don't update the default color. Is this something we need to adjust the theme with the recent changes in Customizer? It used to work without issue before.

#8 in reply to: ↑ 7 @westonruter
5 years ago

Replying to iamtakashi:

The second part of the issue has been fixed but Header Text Color and Background Color still don't update the default color. Is this something we need to adjust the theme with the recent changes in Customizer? It used to work without issue before.

Take a look at #30031. It makes improvements to the ColorControl in Core, but also fixes the Customizer API usage in Twenty Fifteen. It may resolve the issue. I will try to look at it later today myself.

Note: See TracTickets for help on using tickets.