From daba4756cc8bcb7bab20ae6489bf2f5d861dfe42 Mon Sep 17 00:00:00 2001 From: wpmuguru Date: Fri, 28 May 2010 20:03:29 +0000 Subject: [PATCH] don't clobber term if sitecategories doesn't exist, fixes 13482 git-svn-id: http://svn.automattic.com/wordpress/trunk@15042 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-functions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 2be710c9c..b3837f772 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -1238,6 +1238,8 @@ function global_terms( $term_id, $deprecated = '' ) { if ( null == $used_global_id ) { $wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $term_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) ); $global_id = $wpdb->insert_id; + if ( empty( $global_id ) ) + return $term_id; } else { $max_global_id = $wpdb->get_var( "SELECT MAX(cat_ID) FROM $wpdb->sitecategories" ); $max_local_id = $wpdb->get_var( "SELECT MAX(term_id) FROM $wpdb->terms" );