Skip to content

Commit

Permalink
Upgrade/Install: Disable maintenance mode when core auto-update fails.
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@58436 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
costdev committed Jun 18, 2024
1 parent 199bc9d commit d5a2b44
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wp-admin/includes/class-wp-automatic-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,9 @@ public function update( $type, $item ) {
&& ( '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.
Expand Down

0 comments on commit d5a2b44

Please sign in to comment.