mirror of
https://github.com/WordPress/WordPress.git
synced 2025-04-10 22:16:04 +02:00
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
This commit is contained in:
parent
10e842a662
commit
aeb5d2ef17
@ -419,9 +419,10 @@ class WP_Automatic_Updater {
|
|||||||
return false;
|
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 ) ) {
|
if ( is_wp_error( $upgrade_result ) ) {
|
||||||
$skin->error( __( 'Installation failed.' ), $upgrade_result );
|
$upgrade_result->add( 'installation_failed', __( 'Installation failed.' ) );
|
||||||
|
$skin->error( $upgrade_result );
|
||||||
} else {
|
} else {
|
||||||
$skin->feedback( __( 'WordPress updated successfully.' ) );
|
$skin->feedback( __( 'WordPress updated successfully.' ) );
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user