[wp-trac] [WordPress Trac] #61114: PHP 8+ Fatal Error in WP_Upgrader due to TypeError in array_keys() Call
WordPress Trac
noreply at wordpress.org
Thu May 2 16:03:34 UTC 2024
#61114: PHP 8+ Fatal Error in WP_Upgrader due to TypeError in array_keys() Call
-----------------------------+------------------------------
Reporter: verygoode | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Upgrade/Install | Version: 2.8
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
-----------------------------+------------------------------
Comment (by verygoode):
A quick way to reproduce is to spin up a site, set one or more plugins to
a previous version like `wp plugin install hello-dolly --version=1.6
--force`
Then, run multiple requests at the same time to `wp plugin update hello-
dolly` -- simulating a situation where multiple events are firing off to
update something and leading to failures like reported on #53705
Without the casting, we can observe the fatal.
{{{
wp plugin update hello-dolly
Enabling Maintenance mode...
Downloading update from https://downloads.wordpress.org/plugin/hello-
dolly.1.7.3.zip...
Unpacking the update...
Installing the latest version...
Error: There has been a critical error on this website.Learn more about
troubleshooting WordPress. There has been a critical error on this
website.
}}}
With your casting recommendation, this fails without a fatal @afragen
{{{
wp plugin update hello-dolly
Enabling Maintenance mode...
Downloading update from https://downloads.wordpress.org/plugin/hello-
dolly.1.7.3.zip
Unpacking the update...
Installing the latest version...
Warning: Could not move the old version to the upgrade-temp-backup
directory.
Plugin update failed.
Disabling Maintenance mode...
+-------------+-------------+-------------+--------+
| name | old_version | new_version | status |
+-------------+-------------+-------------+--------+
| hello-dolly | 1.6 | 1.7.2 | Error |
+-------------+-------------+-------------+--------+
Error: No plugins updated (1 failed).
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61114#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list