﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
13391	wpmu-terms.php fails if there are more terms in the blog's terms table than there are in wp_sitecategories	mkanat	donncha	"fix_blog_terms in wpmu-terms does this:

$maxterm = $wpdb->get_var( ""SELECT max(cat_ID) FROM {$wpdb->sitecategories}"" )

Then later it does this:

$term_id = $row->term_id + mt_rand( $maxterm+100, $maxterm+4000 );

However, if there are thousands of terms in the blog's terms table, and only a few terms in wp_sitecategories, this will result in term_ids that conflict with other term_ids in $wpdb->terms.

The simple (though probably not ideal) solution is to change the $maxterm line to:


        $maxterm = max($wpdb->get_var( ""SELECT max(cat_ID) FROM {$wpdb->sitecategories}"" ),
                       $wpdb->get_var( ""SELECT max(cat_ID) FROM {$wpdb->terms}"" ) );
"	defect (bug)	closed	normal	MU 2.9.x	Administration	2.9.2	normal	wontfix	close	
