Make WordPress Core

Opened 7 months ago

Closed 6 months ago

Last modified 6 months ago

#59566 closed defect (bug) (fixed)

Twenty Nineteen: The color palette shows incorrect names

Reported by: poena's profile poena Owned by: poena's profile poena
Milestone: 6.4 Priority: normal
Severity: normal Version: 5.3
Component: Bundled Theme Keywords: has-patch has-screenshots has-testing-info commit
Focuses: Cc:

Description (last modified by SergeyBiryukov)

In the block editor, the first two colors in the theme's color palette shows incorrect names.
Instead of the names "Blue" and "Dark blue", the editor shows the color code.
The color code is only intended to show when the user has enabled the custom color option in the Customizer.

This is a follow up to #46698.

Testing instructions

First, if you are not using a fresh install, please reset your WordPress installation.

This is needed to make sure that you have not already saved a value for the custom color option in the customizer.

This is because the default value for the customizer option is
false, and this value is changed to the string "custom" if you have enabled the color option, and the string "default" if you have enabled the custom color and then set it back to default colors.

Activate Twenty Nineteen.
Open the block editor.
Select any block with a color option, for example a paragraph.
Select the color option to open the color selection modal.
Hover over the first and second colors and confirm if the tooltip shows the correct text.

Expected result:
The tooltip of the first color should say "Blue"
The tooltip of the second color should say "Dark blue"

Actual result:
The tooltip of the first and second colors shows a color code

Attachments (10)

color-palette-2023-10-09.png (122.3 KB) - added by poena 7 months ago.
Twenty Nineteen color palette that shows color codes instead of color names,
After PR changes.png (97.9 KB) - added by mukesh27 7 months ago.
before-patch.png (65.5 KB) - added by syamraj24 7 months ago.
Before Patch
after-patch.png (66.6 KB) - added by syamraj24 7 months ago.
After Patch
Before Patch.png (81.5 KB) - added by balub 7 months ago.
Before Patch
After Patch.2.png (82.2 KB) - added by balub 7 months ago.
After patch
Before Patch.2.png (137.3 KB) - added by vivekawsm 6 months ago.
Before patch
After Patch.3.png (111.6 KB) - added by vivekawsm 6 months ago.
After patch
before patch 2019.jpg (102.9 KB) - added by nithins53 6 months ago.
beforepatch2019
after patch 2019.jpg (97.1 KB) - added by nithins53 6 months ago.
afterpatch2019

Download all attachments as: .zip

Change History (33)

#1 @poena
7 months ago

  • Owner set to poena
  • Status changed from new to assigned

@poena
7 months ago

Twenty Nineteen color palette that shows color codes instead of color names,

#2 @poena
7 months ago

  • Description modified (diff)

#3 @poena
7 months ago

  • Milestone changed from Awaiting Review to 6.5
  • Version set to 5.3

This ticket was mentioned in PR #5435 on WordPress/wordpress-develop by @poena.


7 months ago
#4

  • Keywords has-patch added

This PR solves a problem with the names in the color palette in Twenty Nineteen. Instead of displaying the color names, two of the default colors displayed the color clode.

The PR adjusts the logic for displaying the color name, to make sure that the string value 'default' is not compared with false, by adding the default value as a parameter to get_theme_mod( 'primary_color' )

Trac ticket: https://core.trac.wordpress.org/ticket/59566

#5 @poena
7 months ago

  • Keywords needs-testing added

#6 @poena
7 months ago

  • Description modified (diff)

#7 @mukesh27
7 months ago

  • Summary changed from Twenty Ninteen: The color palette shows incorrect names to Twenty Nineteen: The color palette shows incorrect names

#8 @mukesh27
7 months ago

  • Keywords has-screenshots has-testing-info added

Thanks @poena for the ticket and PR.

The PR solve the issue that raised in this issue. Check attached screenshot.

Could we move it in 6.4 instead as it's small fix.

#9 @ugyensupport
7 months ago

Bug Report

Description

In the block editor, the first two colors in the theme's color palette shows incorrect names.
Instead of the names "Blue" and "Dark blue", the editor shows the color code.
The color code is only intended to show when the user has enabled the custom color option in the Customizer.

Environment

  • WordPress: 6.4-beta2-56802
  • PHP: 8.0.0
  • Server: Apache/2.4.10 (Debian)
  • Database: mysqli (Server: 5.5.59-MariaDB-1~wheezy / Client: 5.5.62)
  • Browser: Chrome 117.0.0.0 (macOS)
  • Theme: Twenty Nineteen 2.6
  • MU-Plugins: None activated
  • Plugins:
    • WordPress Beta Tester 3.5.4

Steps to Reproduce

First, if you are not using a fresh install, please reset your WordPress installation. This is needed to make sure that you have not already saved a value for the custom color option in the customizer. This is because the default value for the customizer option is false, and this value is changed to the string "custom" if you have enabled the color option, and the string "default" if you have enabled the custom color and then set it back to default colors.
Activate Twenty Nineteen.
Open the block editor.
Select any block with a color option, for example a paragraph.
Select the color option to open the color selection modal.
Hover over the first and second colors and confirm if the tooltip shows the correct text.
🐞 Bug occurs.

Expected Results

  1. The tooltip of the first color should say "Blue" ✅ The tooltip of the second color should say "Dark blue" ✅

Actual Results

  1. After patch - https://ibb.co/7k4M4BG

Remark

I would agree with @mukesh27 It would be great to see this change in WordPress 6.4

Last edited 7 months ago by ugyensupport (previous) (diff)

#10 @shailu25
7 months ago

Test Report

Tested Patch: https://github.com/WordPress/wordpress-develop/pull/5435

Environment

WordPress: 6.3.1
PHP: 8.1.23
Server: nginx
Browser: Chrome
Theme: Twenty Nineteen
Plugins: None activated

Expected Results :

  • The tooltip of the first colour should say "Blue"
  • The tooltip of the second colour should say "Dark blue"

Actual Results:

  • The Patch is Working Fine As Expected ✅

Screenshots

Before Patch:
https://prnt.sc/QF7zPQaM9pid
https://prnt.sc/8gWzxsRTgOWS

After Patch:
https://prnt.sc/ozsHcPdUHM_S
https://prnt.sc/VA1dK8L7WbUT

Last edited 7 months ago by shailu25 (previous) (diff)

#11 @anveshika
7 months ago

Test Report

Patch used- https://github.com/WordPress/wordpress-develop/pull/5435

Testing Environment-
WordPress - 6.4-beta2-56802
Web Server: Apache
OS - Windows 10
Theme: Twenty Nineteen
PHP - 8.0.29

Test result-
The PR works as expected.✅

Screenshot attached:

https://prnt.sc/mDinq0ZrF-wR

#12 @harshgajipara
7 months ago

Test Report

This report validates that the indicated patch addresses the issue.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/5435

Environment

OS: Windows
PHP: 8.1.9
WordPress: 6.3.1
Browser: Chrome
Theme: Twenty Nineteen
Plugins: None activated

Actual Results

✅ The tooltip of the first color say "Blue" and the tooltip of the second color say "Dark blue"
https://prnt.sc/gUvjgjuA5sEi
https://prnt.sc/b107-MSPw_Gz

Last edited 7 months ago by harshgajipara (previous) (diff)

#13 @poena
7 months ago

  • Milestone changed from 6.5 to 6.4

It can be moved to 6.4, I did not want to stress.

#14 @poena
7 months ago

  • Keywords needs-testing removed

#15 @nicolefurlan
7 months ago

Looks like we have some passing test reports! @poena does this seem ready for commit?

#16 @poena
7 months ago

  • Keywords commit added

#17 @syamraj24
7 months ago

Test Report
Patch used- https://github.com/WordPress/wordpress-develop/pull/5435
Testing Environment-
WordPress - 6.3.1
Web Server: Apache
OS - Windows 10
Theme: Twenty Nineteen
PHP - 8.0.29
Test result-
The patch works as expected.

@syamraj24
7 months ago

Before Patch

@syamraj24
7 months ago

After Patch

#18 @balub
7 months ago

Test Report

Patch used- https://github.com/WordPress/wordpress-develop/pull/5435

Testing Environment-
WordPress - 6.3.1
Web Server: Apache
OS - Mac os 13.4.1
Theme: Twenty Nineteen
PHP - 8.0.29

Test result - The patch works as expected.

@balub
7 months ago

Before Patch

@balub
7 months ago

After patch

#19 @vivekawsm
6 months ago

Test Report
I tested this on 6.4-beta3-56831
The issue is gone after applying the patch.
Below is the test report. Attaching images for reference as well.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/5435

Environment

  • WordPress: 6.4-beta3-56831
  • PHP: 8.2.4
  • Server: Apache/2.4.56 (Win64) OpenSSL/1.1.1t PHP/8.2.4
  • Database: mysqli (Server: 10.4.28-MariaDB / Client: 8.2.4)
  • Browser: Chrome 118.0.0.0 (Windows 10/11)
  • Theme: Twenty Nineteen 2.6
  • MU-Plugins: None activated
  • Plugins:
    • WordPress Beta Tester 3.5.4

Actual Results
.Issue solved after applying the patch

@vivekawsm
6 months ago

Before patch

@vivekawsm
6 months ago

After patch

#20 @SergeyBiryukov
6 months ago

  • Description modified (diff)

#21 @nithins53
6 months ago

Test Report
Patch used- https://github.com/WordPress/wordpress-develop/pull/5435
Testing Environment-
WordPress - 6.3.1
Web Server: Apache
OS - Windows 10
Theme: Twenty Nineteen
Test result-
The patch works as expected. Attaching screenshots below.

@nithins53
6 months ago

beforepatch2019

@nithins53
6 months ago

afterpatch2019

#22 @SergeyBiryukov
6 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 56935:

Twenty Nineteen: Correctly display default color names in the color palette.

Instead of displaying the color names, two of the default colors displayed the color code, which was only intended to show when the user has enabled the custom color option in the Customizer.

The reason is that the default value for the option is false, and this value is changed to the string 'custom' if the color option is enabled, and the string 'default' if the custom color is enabled and then reset to default colors.

This commit adjusts the logic for displaying the color name, to make sure that the string value 'default' is not compared with false, by adding the default value as a parameter to get_theme_mod( 'primary_color' ).

Follow-up to [45964].

Props poena, mukesh27, ugyensupport, shailu25, anveshika, harshgajipara, nicolefurlan, syamraj24, balub, vivekawsm.
Fixes #59566.

@SergeyBiryukov commented on PR #5435:


6 months ago
#23

Thanks for the PR! Merged in r56935.

Note: See TracTickets for help on using tickets.