ClassicPress / ClassicPress-v1

A copy of ClassicPress v1.x.
1 stars 1 forks source link

🐞 Fatal error in dashboard widget "ClassicPress News" in PHP8 #10

Closed xxsimoxx closed 1 year ago

xxsimoxx commented 1 year ago

Expected behavior

No errors.

Current behavior

Using develop and PHP 8 and visiting the dashboard.

[11-Nov-2022 14:29:43 UTC] PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument ClassicPress/ClassicPress#1 ($callback) must be a valid callback, non-static method WP_Feed_Cache::create() cannot be called statically in /var/www/vhosts/.../src/wp-includes/SimplePie/Registry.php:215
Stack trace:
#0 /var/www/vhosts/.../src/wp-includes/class-simplepie.php(1466): SimplePie_Registry->call()
ClassicPress/ClassicPress#1 /var/www/vhosts/.../src/wp-includes/feed.php(717): SimplePie->init()
ClassicPress/ClassicPress#2 /var/www/vhosts/.../src/wp-includes/widgets.php(1428): fetch_feed()
ClassicPress/ClassicPress#3 /var/www/vhosts.../wp-admin/includes/dashboard.php(1202): wp_widget_rss_output()
ClassicPress/ClassicPress#4 /var/www/vhosts/.../wp-admin/includes/dashboard.php(1035): wp_dashboard_primary_output()
ClassicPress/ClassicPress#5 /var/www/vhosts/.../src/wp-admin/includes/dashboard.php(1186): wp_dashboard_cached_rss_widget()
ClassicPress/ClassicPress#6 /var/www/vhosts/.../src/wp-admin/includes/ajax-actions.php(342): wp_dashboard_primary()
ClassicPress/ClassicPress#7 /var/www/vhosts/.../wp-includes/class-wp-hook.php(287): wp_ajax_dashboard_widgets()
ClassicPress/ClassicPress#8 /var/www/vhosts/.../wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters()
ClassicPress/ClassicPress#9 /var/www/vhosts/.../wp-includes/plugin.php(458): WP_Hook->do_action()
ClassicPress/ClassicPress#10 /var/www/vhosts/.../wp-admin/admin-ajax.php(164): do_action()
ClassicPress/ClassicPress#11 {main}
thrown in /var/www/.../wp-includes/SimplePie/Registry.php on line 215

Possible solution

Those lines can point to a solution.

Steps to reproduce bug

  1. Checkout develop
  2. Go to the dashboard
  3. Look at the "ClassicPress News" widget
  4. Look at the logs

Context

No response

ClassicPress version

develop

PHP version

8.0

Can you help?

I can help test a solution

mattyrob commented 1 year ago

Seems we may need a backport for this: https://core.trac.wordpress.org/changeset/49565