From aeb5d2ef17d8cf2a11f8a5b2a514ccb8a8f22b4d Mon Sep 17 00:00:00 2001 From: davidbaumwald Date: Fri, 7 Jan 2022 17:55:01 +0000 Subject: [PATCH] Upgrade/Install: Fix parameter count in `error` call when an automatic core upgrade fails. During automatic core upgrades, if installation results in a `WP_Error`, the `error` method is called on the skin with the details. However, in this case, two parameters are passed to `$skin->error`, but only one is accepted. This change passes only the running `WP_Error` instance as the sole parameter to `$skin->error`. Also, this change adds an additional error to `$upgrade_result` before finally being passed to `$skin->error`, indicating that the installation failed. This adds additional context to the failure. Props desrosj, sainthkh, devutpol, SergeyBiryukov. Fixes #53284. Built from https://develop.svn.wordpress.org/trunk@52539 git-svn-id: http://core.svn.wordpress.org/trunk@52129 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-automatic-updater.php | 5 +++-- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-automatic-updater.php b/wp-admin/includes/class-wp-automatic-updater.php index aded48b275..7ba6b71b52 100644 --- a/wp-admin/includes/class-wp-automatic-updater.php +++ b/wp-admin/includes/class-wp-automatic-updater.php @@ -419,9 +419,10 @@ class WP_Automatic_Updater { return false; } - // Core doesn't output this, so let's append it so we don't get confused. + // Core doesn't output this, so let's append it, so we don't get confused. if ( is_wp_error( $upgrade_result ) ) { - $skin->error( __( 'Installation failed.' ), $upgrade_result ); + $upgrade_result->add( 'installation_failed', __( 'Installation failed.' ) ); + $skin->error( $upgrade_result ); } else { $skin->feedback( __( 'WordPress updated successfully.' ) ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 46ec9c43a2..5169623e36 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52538'; +$wp_version = '6.0-alpha-52539'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.