#63560 closed defect (bug) (invalid)
Fatal error on my theme
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | major | Version: | 6.8 |
| Component: | Themes | Keywords: | |
| Focuses: | Cc: |
Description
Hello,
I received an email about a fatal error for my theme.
I did multiple tests on my local and on the playground, and I didn't find any case which lead to a fatal error.
Playground link : http://playground.wordpress.net/?php=8.1&networking=yes&theme=simppple
Theme link : https://wordpress.org/themes/simppple/
Here's the message I got :
"Your theme simppple has been delisted due to a fatal error on wp-themes.com, which currently runs PHP 8.1.
The error is:
E_ERROR: Uncaught TypeError: Simppple\ThemeCustomization\remove_default_values_from_CSS_variables(): Argument #1 ($theme_json) must be of type WP_Theme_JSON_Data, WP_Theme_JSON_Data_Gutenberg given, called in /wp/wp-includes/class-wp-hook.php on line 324 and defined in /wp-content/themes/simppple/inc/theme-customization/theme-remove-default-settings.php:24
Although the above fatal references wp-includes, we believe the error is caused by the theme itself, rather than core WordPress."
I don't know what to do since I cannot reproduce the problem..
This has been resolved via an email to themes@…, and https://themes.trac.wordpress.org/changeset/275578
The theme in question was requiring a
WP_Theme_JSON_Dataobject in a filter, and not expecting aWP_Theme_JSON_Data_Gutenbergobject from Gutenberg hooking to that filter.