From 7fd0cb8c83174f68f2b9dfae016c7754c588f62e Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sun, 3 Jun 2007 18:57:14 +0000 Subject: [PATCH] Upgrade fixes. see #4189 git-svn-id: https://develop.svn.wordpress.org/trunk@5643 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/upgrade.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 31cfbe962d..6457754c84 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -607,22 +607,29 @@ function upgrade_230() { $wpdb->query("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES ('$term_id', '$name', '$slug', '$term_group')"); + $count = 0; if ( !empty($category->category_count) ) { $count = (int) $category->category_count; $taxonomy = 'category'; $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')"); $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; - } else if ( !empty($category->link_count) ) { + } + + if ( !empty($category->link_count) ) { $count = (int) $category->link_count; $taxonomy = 'link_category'; $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')"); $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; - } else if ( !empty($category->tag_count) ) { + } + + if ( !empty($category->tag_count) ) { $count = (int) $category->tag_count; $taxonomy = 'post_tag'; $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')"); $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; - } else { + } + + if ( empty($count) ) { $count = 0; $taxonomy = 'category'; $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");