Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: useColors crash when themes remove the color pallete #18286

Conversation

jorgefilipecosta
Copy link
Member

Description

Fixes: #18232

The useColors hook did not handle the case where themes disable color palette using:

add_theme_support( 'editor-color-palette' );

This PR fixes the issue.

How has this been tested?

I added the following code to the functions.php file of the currently enabled theme (removing the code it contained setting a color palette):

add_theme_support( 'editor-color-palette' );

I opened the editor, added a heading block, verified the block did not crash (on master it crashes), verified no preset colors were available.

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Block] Heading Affects the Headings Block labels Nov 5, 2019
@jorgefilipecosta jorgefilipecosta merged commit 497b42b into master Nov 6, 2019
@jorgefilipecosta jorgefilipecosta deleted the fix/useColors-crashes-when-themes-remove-the-color-pallete branch November 6, 2019 20:00
@youknowriad youknowriad added this to the Gutenberg 6.9 milestone Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Heading Affects the Headings Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Heading block "encountered an error" since 6.8.0
3 participants