The MU forums have moved to

Upgrade issue with OLD db (3 posts)

  1. zappoman
    Posted 15 years ago #

    I have only tested and seen this on DB versions 3845 and earlier. But as I read the upgrade_230() function code, I don't see how this would work in other cases either.

    Here's what I saw. I have a MU instance that running very old code, PRE-taxonomy code. It has never had the taxonomy upgraded.

    I did the standard /wp-admin/upgrade.php and stepped through the upgrade process. What I get is a bunch of categories that are all named "" and their slugs are "-2", "-2-2", "-2-2-2"... Of course, most themes will render this as "Filed Under:" where there is no text after that, because the category name is blank.

    Debugging this, I found that the upgrade_230() function will load the categories from $wpdb->categories on line 551... everything looks great. But then on line 557 it attempts to use the local variable $slug, that has not been set and is null. Also on line 575 it attempts to INSERT the category name as a term, but $name and $slug are not correctly set up.. the result is that these are inserted as NULL and NULL (or "-2", "-2-2",...)

    I believe the fix for this is to add the following code around line 555

    $name = $wpdb->escape($category->cat_name);
    $slug = $wpdb->escape($category->category_nicename);

  2. donncha
    Key Master
    Posted 15 years ago #

    Replied in ticket, this was fixed in 2.6.1

  3. zappoman
    Posted 15 years ago #

    Strange, I was pretty certain I had the 2.6.1 code base. I guess I'd better double check that.

About this Topic

  • Started 15 years ago by zappoman
  • Latest reply from zappoman