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

Make syntax errors in theme.json visible to users #32404

Merged

Conversation

@oandregal
Copy link
Member

@oandregal oandregal commented Jun 2, 2021

Fixes #32009
Alternative to #32369

When we process theme.json data that has a syntax error according the JSON standard, we log an error to the console. Theme authors have expressed this is not enough. This PR makes the error visible in the browser as well.

See what happens when the theme.json has a syntax error:

Captura de ecrã de 2021-06-02 17-55-15

How to test

  • Use a theme with theme.json support.
  • Remove one of the commas.
  • Load the front end or editors.

The expected result is that you should see an error similar to the screenshot shared above.

@oandregal
Copy link
Member Author

@oandregal oandregal commented Jun 2, 2021

If we want to raise the importance of the error to this level, I believe this should be ported to WordPress core.

@oandregal oandregal added this to 🏗️ In progress in WordPress 5.8 Must Haves via automation Jun 2, 2021
Copy link
Contributor

@youknowriad youknowriad left a comment

I don't have strong preferences personally.

@oandregal oandregal merged commit 9ef56be into trunk Jun 4, 2021
18 checks passed
18 checks passed
@github-actions
Bump version
Details
@github-actions
Checks (12)
Details
@github-actions
Admin - 1 Admin - 1
Details
@github-actions
Run performance tests
Details
@github-actions
pull-request-automation
Details
@github-actions
test (gutenberg-editor-initial-html)
Details
@github-actions
test (12.2, gutenberg-editor-initial-html)
Details
@github-actions
JavaScript (12)
Details
@github-actions
Checks (14)
Details
@github-actions
Admin - 2 Admin - 2
Details
@github-actions
JavaScript (14)
Details
@github-actions
Admin - 3 Admin - 3
Details
@github-actions
Admin - 4 Admin - 4
Details
@github-actions
Build Release Artifact
Details
@github-actions
Create Release Draft and Attach Asset
Details
@github-actions
Mobile
Details
WordPress 5.8 Must Haves automation moved this from 🏗️ In progress to ✅ Done Jun 4, 2021
@oandregal oandregal deleted the try/trigger-user-error-upon-theme-json-decoding-error branch Jun 4, 2021
@github-actions github-actions bot added this to the Gutenberg 10.9 milestone Jun 4, 2021
youknowriad added a commit to youknowriad/wordpress-develop that referenced this pull request Jun 7, 2021
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Jun 8, 2021
This includes the following fixes:


Widgets Editor:
  - Load widgets.php WordPress/gutenberg#32299
 - Fix Legacy Widget Preview WordPress/gutenberg#32300
 - Fix error when saving empty Legacy Widget block WordPress/gutenberg#32359

Widget blocks in the customizer: 
 - Fix deselection blocks when the inspector is open WordPress/gutenberg#32361
 - Display wide widgets as popovers WordPress/gutenberg#31736

Global Styles:
 - Align classNames generation between client and server WordPress/gutenberg#32352
 - Group typography block supports WordPress/gutenberg#32252 WordPress/gutenberg#32444 WordPress/gutenberg#32459
 - Make theme.json syntax errors more visible to the users WordPress/gutenberg#32404


Template Editor:
  - Update the appearance of the template details WordPress/gutenberg#32042
  - Fix layout definition WordPress/gutenberg#32425
  - Fix grouping post content block WordPress/gutenberg#32453

Miscellaneous:
 - Prevent saving when the post is locked WordPress/gutenberg#32341
 - Fix allowed block patterns selector WordPress/gutenberg#32376
 - Fix wrong results in the Post Author picker WordPress/gutenberg#32344
 - Fix notices position in top toolbar mode WordPress/gutenberg#32238
 - Allow non-latin characters in post slugs WordPress/gutenberg#32232
 - Fix Random collapse of the color settings panel WordPress/gutenberg#32388
 - Fix theme logo theme mode not being removed on theme removal WordPress/gutenberg#32370
 - Fix block alignment styles in the editor WordPress/gutenberg#32454
 - Fix some block toolbar overlaps WordPress/gutenberg#32424
 - Fix content loss when switching list types WordPress/gutenberg#32432


Performance:
 - Improve the performance of buttons block WordPress/gutenberg#32356
 - Improve the performance of the container blocks WordPress/gutenberg#32380

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.


git-svn-id: https://develop.svn.wordpress.org/trunk@51089 602fd350-edb4-49c9-b593-d223f7449a82
nylen pushed a commit to nylen/wordpress-develop-svn that referenced this pull request Jun 8, 2021
This includes the following fixes:


Widgets Editor:
  - Load widgets.php WordPress/gutenberg#32299
 - Fix Legacy Widget Preview WordPress/gutenberg#32300
 - Fix error when saving empty Legacy Widget block WordPress/gutenberg#32359

Widget blocks in the customizer: 
 - Fix deselection blocks when the inspector is open WordPress/gutenberg#32361
 - Display wide widgets as popovers WordPress/gutenberg#31736

Global Styles:
 - Align classNames generation between client and server WordPress/gutenberg#32352
 - Group typography block supports WordPress/gutenberg#32252 WordPress/gutenberg#32444 WordPress/gutenberg#32459
 - Make theme.json syntax errors more visible to the users WordPress/gutenberg#32404


Template Editor:
  - Update the appearance of the template details WordPress/gutenberg#32042
  - Fix layout definition WordPress/gutenberg#32425
  - Fix grouping post content block WordPress/gutenberg#32453

Miscellaneous:
 - Prevent saving when the post is locked WordPress/gutenberg#32341
 - Fix allowed block patterns selector WordPress/gutenberg#32376
 - Fix wrong results in the Post Author picker WordPress/gutenberg#32344
 - Fix notices position in top toolbar mode WordPress/gutenberg#32238
 - Allow non-latin characters in post slugs WordPress/gutenberg#32232
 - Fix Random collapse of the color settings panel WordPress/gutenberg#32388
 - Fix theme logo theme mode not being removed on theme removal WordPress/gutenberg#32370
 - Fix block alignment styles in the editor WordPress/gutenberg#32454
 - Fix some block toolbar overlaps WordPress/gutenberg#32424
 - Fix content loss when switching list types WordPress/gutenberg#32432


Performance:
 - Improve the performance of buttons block WordPress/gutenberg#32356
 - Improve the performance of the container blocks WordPress/gutenberg#32380

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.


git-svn-id: https://develop.svn.wordpress.org/trunk@51089 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Jun 8, 2021
This includes the following fixes:


Widgets Editor:
  - Load widgets.php WordPress/gutenberg#32299
 - Fix Legacy Widget Preview WordPress/gutenberg#32300
 - Fix error when saving empty Legacy Widget block WordPress/gutenberg#32359

Widget blocks in the customizer: 
 - Fix deselection blocks when the inspector is open WordPress/gutenberg#32361
 - Display wide widgets as popovers WordPress/gutenberg#31736

Global Styles:
 - Align classNames generation between client and server WordPress/gutenberg#32352
 - Group typography block supports WordPress/gutenberg#32252 WordPress/gutenberg#32444 WordPress/gutenberg#32459
 - Make theme.json syntax errors more visible to the users WordPress/gutenberg#32404


Template Editor:
  - Update the appearance of the template details WordPress/gutenberg#32042
  - Fix layout definition WordPress/gutenberg#32425
  - Fix grouping post content block WordPress/gutenberg#32453

Miscellaneous:
 - Prevent saving when the post is locked WordPress/gutenberg#32341
 - Fix allowed block patterns selector WordPress/gutenberg#32376
 - Fix wrong results in the Post Author picker WordPress/gutenberg#32344
 - Fix notices position in top toolbar mode WordPress/gutenberg#32238
 - Allow non-latin characters in post slugs WordPress/gutenberg#32232
 - Fix Random collapse of the color settings panel WordPress/gutenberg#32388
 - Fix theme logo theme mode not being removed on theme removal WordPress/gutenberg#32370
 - Fix block alignment styles in the editor WordPress/gutenberg#32454
 - Fix some block toolbar overlaps WordPress/gutenberg#32424
 - Fix content loss when switching list types WordPress/gutenberg#32432


Performance:
 - Improve the performance of buttons block WordPress/gutenberg#32356
 - Improve the performance of the container blocks WordPress/gutenberg#32380

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.

Built from https://develop.svn.wordpress.org/trunk@51089


git-svn-id: http://core.svn.wordpress.org/trunk@50698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
gMagicScott pushed a commit to gMagicScott/core.wordpress-mirror that referenced this pull request Jun 8, 2021
This includes the following fixes:


Widgets Editor:
  - Load widgets.php WordPress/gutenberg#32299
 - Fix Legacy Widget Preview WordPress/gutenberg#32300
 - Fix error when saving empty Legacy Widget block WordPress/gutenberg#32359

Widget blocks in the customizer: 
 - Fix deselection blocks when the inspector is open WordPress/gutenberg#32361
 - Display wide widgets as popovers WordPress/gutenberg#31736

Global Styles:
 - Align classNames generation between client and server WordPress/gutenberg#32352
 - Group typography block supports WordPress/gutenberg#32252 WordPress/gutenberg#32444 WordPress/gutenberg#32459
 - Make theme.json syntax errors more visible to the users WordPress/gutenberg#32404


Template Editor:
  - Update the appearance of the template details WordPress/gutenberg#32042
  - Fix layout definition WordPress/gutenberg#32425
  - Fix grouping post content block WordPress/gutenberg#32453

Miscellaneous:
 - Prevent saving when the post is locked WordPress/gutenberg#32341
 - Fix allowed block patterns selector WordPress/gutenberg#32376
 - Fix wrong results in the Post Author picker WordPress/gutenberg#32344
 - Fix notices position in top toolbar mode WordPress/gutenberg#32238
 - Allow non-latin characters in post slugs WordPress/gutenberg#32232
 - Fix Random collapse of the color settings panel WordPress/gutenberg#32388
 - Fix theme logo theme mode not being removed on theme removal WordPress/gutenberg#32370
 - Fix block alignment styles in the editor WordPress/gutenberg#32454
 - Fix some block toolbar overlaps WordPress/gutenberg#32424
 - Fix content loss when switching list types WordPress/gutenberg#32432


Performance:
 - Improve the performance of buttons block WordPress/gutenberg#32356
 - Improve the performance of the container blocks WordPress/gutenberg#32380

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.

Built from https://develop.svn.wordpress.org/trunk@51089


git-svn-id: https://core.svn.wordpress.org/trunk@50698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
F-Wilke added a commit to FiliagoDev/WordPress that referenced this pull request Jul 31, 2021
This includes the following fixes:


Widgets Editor:
  - Load widgets.php WordPress/gutenberg#32299
 - Fix Legacy Widget Preview WordPress/gutenberg#32300
 - Fix error when saving empty Legacy Widget block WordPress/gutenberg#32359

Widget blocks in the customizer: 
 - Fix deselection blocks when the inspector is open WordPress/gutenberg#32361
 - Display wide widgets as popovers WordPress/gutenberg#31736

Global Styles:
 - Align classNames generation between client and server WordPress/gutenberg#32352
 - Group typography block supports WordPress/gutenberg#32252 WordPress/gutenberg#32444 WordPress/gutenberg#32459
 - Make theme.json syntax errors more visible to the users WordPress/gutenberg#32404


Template Editor:
  - Update the appearance of the template details WordPress/gutenberg#32042
  - Fix layout definition WordPress/gutenberg#32425
  - Fix grouping post content block WordPress/gutenberg#32453

Miscellaneous:
 - Prevent saving when the post is locked WordPress/gutenberg#32341
 - Fix allowed block patterns selector WordPress/gutenberg#32376
 - Fix wrong results in the Post Author picker WordPress/gutenberg#32344
 - Fix notices position in top toolbar mode WordPress/gutenberg#32238
 - Allow non-latin characters in post slugs WordPress/gutenberg#32232
 - Fix Random collapse of the color settings panel WordPress/gutenberg#32388
 - Fix theme logo theme mode not being removed on theme removal WordPress/gutenberg#32370
 - Fix block alignment styles in the editor WordPress/gutenberg#32454
 - Fix some block toolbar overlaps WordPress/gutenberg#32424
 - Fix content loss when switching list types WordPress/gutenberg#32432


Performance:
 - Improve the performance of buttons block WordPress/gutenberg#32356
 - Improve the performance of the container blocks WordPress/gutenberg#32380

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.

Built from https://develop.svn.wordpress.org/trunk@51089


git-svn-id: http://core.svn.wordpress.org/trunk@50698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Linked issues

Successfully merging this pull request may close these issues.

2 participants