From 7ef82c235a553f0254058f11c7a0468d788aa8d4 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sun, 9 Aug 2015 02:21:11 +0000 Subject: [PATCH] Upgrade: Skip the sitecategories table when it doesn't exist (Global Terms is disabled). Props nofearinc, obenland, SergeyBiryukov, and pento. Fixes #33206 git-svn-id: https://develop.svn.wordpress.org/trunk@33597 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/upgrade.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index da1e1ba6e5..86c6f9ade8 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -1685,6 +1685,11 @@ function upgrade_network() { $tables = $wpdb->tables( 'global' ); + // sitecategories may not exist. + if ( ! $this->get_var( "SHOW TABLES LIKE '{$tables['sitecategories']}'" ) ) { + unset( $tables['sitecategories'] ); + } + foreach ( $tables as $table ) { maybe_convert_table_to_utf8mb4( $table ); } @@ -1709,6 +1714,11 @@ function upgrade_network() { $tables = $wpdb->tables( 'global' ); + // sitecategories may not exist. + if ( ! $this->get_var( "SHOW TABLES LIKE '{$tables['sitecategories']}'" ) ) { + unset( $tables['sitecategories'] ); + } + foreach ( $tables as $table ) { maybe_convert_table_to_utf8mb4( $table ); }