From c7a7a7f155c9e4036c66c690344566d501788a58 Mon Sep 17 00:00:00 2001 From: nacin <nacin@1a063a9b-81f0-0310-95a4-ce76da25c4cd> 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: http://svn.automattic.com/wordpress/trunk@14096 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 ) {