Support » Fixing WordPress » 2004-03-01: categories bug

  • I can’t find this mentioned anywhere else on the message board, and it hasn’t been fixed through several nightly releases, so… creating a category with no parent (or just editing the General category, since it has no parent) causes a database error:
    UPDATE wptest_categories SET cat_name = 'General', category_nicename = 'general', category_description = '', category_parent = WHERE cat_ID = 1

Viewing 4 replies - 1 through 4 (of 4 total)
  • I know what you mean… that bug has been around for at least 3-4 nightly builds!
    The quickfix if you know PHP is to find line 126 in wp-admin/categories.php and change category_parent = $cat to category_parent = ‘$cat’ . $cat doesn’t return anything since there is no parent, but the devs forgot to include the apostrophes. There is a similar place in the same file with the same issue, but it may have been fixed.
    Hope this helps!

    huh, the same bug report is just 4 lines below your post with almost the same subject line here in this beta forum.
    anyway you also need to edit line 52:
    $wpdb->query("INSERT INTO $tablecategories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', $cat)");
    to:
    $wpdb->query("INSERT INTO $tablecategories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')");
    $cat needs those ‘ ‘ too.
    if you get any more db errors then search for missing ‘ apostrophes near that error.
    hth
    ihad.

    Sorry ihad, didn’t see the other post. There’s multiple places with the missing apostrophes, though, so it’s nice to have both lines in the same thread for future bug fixing.

    it’s rather sberg not you who had problems finding any mention of that bug 😉
    no worries.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘2004-03-01: categories bug’ is closed to new replies.