in the near future (eg, next week), I will proceed with the upgrade of the blog to the version 6.0 of Wordpress (because the older one is no longer supported, if I understand well their page). At the same time, the php version will be upgraded to 8.0.
A fix have been submitted for the plugin, so it wait on a review and a release. So the php 8 upgrade is on hold, but the WP one should proceed (on stg first, for the site who have a staging instance)
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function WP_Widget::__construct(), 0 passed in /nas/content/live/fedoramagstg/wp-includes/class-wp-widget-factory.php on line 61 and at least 2 expected in /nas/content/live/fedoramagstg/wp-includes/class-wp-widget.php:162
Stack trace:
#0 /nas/content/live/fedoramagstg/wp-includes/class-wp-widget-factory.php(61): WP_Widget->__construct()
#1 /nas/content/live/fedoramagstg/wp-includes/widgets.php(115): WP_Widget_Factory->register('magazine_postse...')
#2 /nas/content/live/fedoramagstg/wp-content/themes/fmag2018-1.02/widgets/magazine-postseries-widget.php(64): register_widget('magazine_postse...')
#3 /nas/content/live/fedoramagstg/wp-content/themes/fmag2018-1.02/functions.php(172): require_once('/nas/content/li...')
#4 /nas/content/live/fedoramagstg/wp-settings.php(555): include('/nas/content/li...')
#5 /nas/content/live/fedoramagstg/wp-config.php(120): require_once('/nas/content/li...')
#6 /nas/content/live/fedoramagstg/wp-load.php(50): require_once('/nas/content/li...')
#7 /nas/content/live/fedoramagstg/wp-blog-header.php(13): require_once('/nas/content/li...')
#8 /nas/content/live/fedoramagstg/index.php(17): require('/nas/content/li...')
#9 {main}
thrown in /nas/content/live/fedoramagstg/wp-includes/class-wp-widget.php on line 162
I will take a look later, just dropping the stacktrace here so I can keep people updated (and so I can go straight to coding right away, as I need to update the theme anyway)
I’m sure your experience with PHP is more extensive than mine. The change you suggest looks harmless to me. If it appears to work on a local instance, then I’d say go for it! We can always rollback the theme if we need to.
I’m curious what you mean by “I tested on staging”. I have made theme updates before. But to test them, I ran a local instance of WordPress on my PC as documented here:
Mhh, so likely my fault. I copied the prod environment to stg (for testing), but I guess that stg took over jetpack. Sorry, I forgot about that, and I think it already happened before.
Yeah, I think the trick is to upgrade 1st to WP 6.0 and then to php 8. I have a working instance of php 8 and WP 6 (for next.redhat.com, we host it on the same platform), and I indeed noticed that WP 5.6 + php 8 didn’t work. But 6 work fine but the theme is not the same.
I am still trying to understand how the vendor upgrade system work (cause I say “upgrade” and then, it doesn’t upgrade right away, and sometime, after a while, the instance is upgraded. So far, I am testing on a staging instance, so no fear for the main website.
Ok so I finally managed to get it working. I was experimenting, and I noticed I wasn’t editing the right file. So the constructor is wrong, it need a __construct() function, as explain in a link on the page given by @glb .
@rlengland: Be sure to include Michael’s PR in the theme update that you are working on. I think it should be backwards compatible with the current version of WordPress. Once the theme is updated on the current site, then Michael should be able to cleanly upgrade it to WordPress 6.0 and PHP 8.0.