Upgrade/Install: Disable maintenance mode when core auto-update fails.

In [58128], additional maintenance mode calls were added to the automatic updates process. However, there is an early return if a 'core' automatic update fails.

Maintenance mode isn't disabled until later in the `WP_Automatic_Updater::update()` method. This means that maintenance mode may continue to be enabled despite the core update being treated as a skipped update.

This disables maintenance mode before the early return.

Follow-up to [58128].

Props costdev, hellofromTonya, peterwilsoncc.
Fixes #61459. See #58281.
Built from https://develop.svn.wordpress.org/trunk@58436


git-svn-id: http://core.svn.wordpress.org/trunk@57885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
costdev 2024-06-18 14:41:05 +00:00
parent 09848f0151
commit 6b458a50bf
2 changed files with 4 additions and 1 deletions

View File

@ -511,6 +511,9 @@ class WP_Automatic_Updater {
&& ( 'up_to_date' === $upgrade_result->get_error_code()
|| 'locked' === $upgrade_result->get_error_code() )
) {
// Allow visitors to browse the site again.
$upgrader->maintenance_mode( false );
/*
* These aren't actual errors, treat it as a skipped-update instead
* to avoid triggering the post-core update failure routines.

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-beta2-58435';
$wp_version = '6.6-beta2-58436';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.