From 80159017d2aac8fba390a137812547aacce9db4c Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 3 May 2018 21:15:26 +0000 Subject: [PATCH] Privacy: Return before scheduling cron during install to avoid error. r43046 introduced wp_schedule_delete_old_privacy_export_files() to schedule the wp_privacy_delete_old_export_files cron job, but it did not check to make sure it wasn't running in the context of the install process. When it did run in that context, it created a database error, because the necessary database tables don't exist at that point. Checking the current context and returning early during the installation phase avoids that issue. Props helen, timothyblynjacobs, iandunn. Merges [43162] to the 4.9 branch. Fixes #43952. Built from https://develop.svn.wordpress.org/branches/4.9@43163 git-svn-id: http://core.svn.wordpress.org/branches/4.9@42992 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index d09bc48e3b..103b5b2c0f 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -5952,6 +5952,10 @@ function _wp_privacy_active_plugins_change() { * @since 4.9.6 */ function wp_schedule_delete_old_privacy_export_files() { + if ( wp_installing() ) { + return; + } + if ( ! wp_next_scheduled( 'wp_privacy_delete_old_export_files' ) ) { wp_schedule_event( time(), 'hourly', 'wp_privacy_delete_old_export_files' ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index f113126f16..86db6b4911 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9.6-alpha-43161'; +$wp_version = '4.9.6-alpha-43163'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.