From 82358ca36e1b02db4a56f40117bba4d753fbc70f Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 15 Apr 2010 21:49:42 +0000 Subject: [PATCH] Don't try to repair sitecategories if it doesn't exist. Global terms may be disabled, though we can't check that without a DB Call. fixes #12964 git-svn-id: https://develop.svn.wordpress.org/trunk@14096 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/maint/repair.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-admin/maint/repair.php b/wp-admin/maint/repair.php index 7d8c0b9cb8..6daa5d5283 100644 --- a/wp-admin/maint/repair.php +++ b/wp-admin/maint/repair.php @@ -32,6 +32,9 @@ if ( !defined('WP_ALLOW_REPAIR') ) { $okay = true; $tables = $wpdb->tables(); + // Sitecategories may not exist if global terms are disabled. + if ( is_multisite() && ! $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->sitecategories'" ) ) + unset( $tables['sitecategories'] ); $tables = array_merge( $tables, (array) apply_filters( 'tables_to_repair', array() ) ); // Return tables with table prefixes. // Loop over the tables, checking and repairing as needed. foreach ( $tables as $table ) {