Skip to content

Commit

Permalink
Make syntax errors in theme.json visible to users (#32404)
Browse files Browse the repository at this point in the history
  • Loading branch information
nosolosw authored and youknowriad committed Jun 7, 2021
1 parent fcf8da8 commit 7fbf2b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/class-wp-theme-json-resolver-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static function read_json_file( $file_path ) {

$json_decoding_error = json_last_error();
if ( JSON_ERROR_NONE !== $json_decoding_error ) {
error_log( 'Error when decoding file schema: ' . json_last_error_msg() );
trigger_error( "Error when decoding a theme.json schema at path $file_path " . json_last_error_msg() );
return $config;
}

Expand Down Expand Up @@ -367,7 +367,7 @@ public static function get_user_data() {

$json_decoding_error = json_last_error();
if ( JSON_ERROR_NONE !== $json_decoding_error ) {
error_log( 'Error when decoding user schema: ' . json_last_error_msg() );
trigger_error( 'Error when decoding a theme.json schema for user data. ' . json_last_error_msg() );
return new WP_Theme_JSON_Gutenberg( $config );
}

Expand Down

0 comments on commit 7fbf2b4

Please sign in to comment.