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


Copy link

jorgefilipecosta commented Nov 5, 2019


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 merged commit 497b42b into master Nov 6, 2019
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
@jorgefilipecosta jorgefilipecosta deleted the fix/useColors-crashes-when-themes-remove-the-color-pallete branch Nov 6, 2019
@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
None yet
3 participants
You can’t perform that action at this time.