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

14.5.3 - Fatal Error when installing plugins/themes. #45886

Closed
costdev opened this issue Nov 18, 2022 · 1 comment
Closed

14.5.3 - Fatal Error when installing plugins/themes. #45886

costdev opened this issue Nov 18, 2022 · 1 comment

Comments

@costdev
Copy link
Contributor

costdev commented Nov 18, 2022

Description

With Gutenberg 14.5.3 active on WordPress trunk, installing themes produces a Fatal Error in _wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme().

This is caused by the $accepted_args not being specified when hooking upgrader_process_complete.

In lib/compat/wordpress-6.2/default-filters.php, this line:

add_action( 'upgrader_process_complete', '_wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme' );

Should be:

add_action( 'upgrader_process_complete', '_wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme', 10, 2 );

Introduced in #45543.

Step-by-step reproduction instructions

  1. Install and activate Gutenberg 14.5.3.
  2. Navigate to Appearance > Themes > Add New.
  3. Install a theme. 🐞

Screenshots, screen recording, code snippet

PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function _wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme(), 1 passed in /wp-includes/class-wp-hook.php on line 310 and exactly 2 expected in src/wp-content/plugins/gutenberg/lib/compat/wordpress-6.2/get-global-styles-and-settings.php:67
Stack trace:
/wp-includes/class-wp-hook.php(310): _wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme()
/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
/wp-includes/plugin.php(517): WP_Hook->do_action()
/wp-admin/includes/class-wp-upgrader.php(875): do_action()
/wp-admin/includes/class-theme-upgrader.php(250): WP_Upgrader->run()
/wp-admin/includes/ajax-actions.php(4174): Theme_Upgrader->install( in /wp-content/plugins/gutenberg/lib/compat/wordpress-6.2/get-global-styles-and-settings.php on line 67

Environment info

  • Server: Apache (Linux)
  • WordPress: 6.2-alpha-54642-src
  • Browser: Chrome 107.0.0.0
  • OS: Windows 10
  • Theme: Twenty Twenty-Two
  • Plugins:
    • Gutenberg 14.5.3

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@costdev
Copy link
Contributor Author

costdev commented Nov 18, 2022

Just noticed this was fixed in #45881 - Closing this issue.

@costdev costdev closed this as completed Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant