From db674cc33857498455c668512173e857d3adcbd6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 30 Nov 2021 17:10:19 +0000 Subject: [PATCH] Upgrade/Install: Check that WordPress is installed before scheduling cleanup of the `temp-backup` directory. Trying to schedule cron jobs before WordPress is installed results in DB errors, which is suboptimal. This addresses a `Table 'wp_options' doesn't exist` error when running the installation with `WP_DEBUG` enabled. Follow-up to [51815], [51898], [51899], [51902], [52192]. Props dlh, pbiron. See #51857. git-svn-id: https://develop.svn.wordpress.org/trunk@52284 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-upgrader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php index 6e525219b8..9487dc6cd4 100644 --- a/src/wp-admin/includes/class-wp-upgrader.php +++ b/src/wp-admin/includes/class-wp-upgrader.php @@ -141,7 +141,10 @@ class WP_Upgrader { public function init() { $this->skin->set_upgrader( $this ); $this->generic_strings(); - $this->schedule_temp_backup_cleanup(); + + if ( ! wp_installing() ) { + $this->schedule_temp_backup_cleanup(); + } } /**