The MU forums have moved to WordPress.org

Renaming a category changes category ID? (11 posts)

  1. webmatter
    Member
    Posted 15 years ago #

    Hi there, I just renamed the category 'uncategorized' and afterwards the id changed from id=1 to id=3 ... is this correct? Is it normal procedure that multiuser categories change their id's when renaming them?
    Thanks in advance for enlightening me .. :)

  2. tdjcbe
    Member
    Posted 15 years ago #

    Where specifically did you change the category? Please remember that specifics help solve problems.

    http://codex.wordpress.org/Debugging_WPMU

    When you change the category in a blog, yes, it does change the category ID. If it didn't all those blogs who didn't change the category would be affected.

  3. MrBrian
    Member
    Posted 15 years ago #

    It's normal operation :). The ID's correspond to the global categories table, so if you name a category to something that hasn't yet been created sitewide, the ID will turn into 25 or whatever the ID count of global categories is.

  4. webmatter
    Member
    Posted 15 years ago #

    Thanks for info! Good to know that it's not something unusual ... :)

  5. Computer-Tipps
    Member
    Posted 15 years ago #

    i hope they fix this bug. Only changeing a name of a category should not change the category id!!!
    i alwas have to update my theme because the homepage shows teh categories 7 9 21 foe example. After changing the category hardwore to hardware i have to change the ids from 7 to 42 ....

  6. SteveAtty
    Member
    Posted 15 years ago #

    It is NOT a bug, if you have 40 blogs and they are all using category FRED and I decide that my category should not be FRED but should be JOE then it should not change the categories of their posts, it should only change mine by adding a new category.

    If you've made a typo and FRED should be FERD then I'd be tempted to fix it in the DB back end, that is assuming that everyone else is happy for you to change it.

  7. magicseth
    Member
    Posted 15 years ago #

    I thought each blog had its own taxonomy... Am I wrong? How then could different blogs share the same category FRED?

  8. texet
    Member
    Posted 15 years ago #

    !!OY VEY!! ... this behavior wreaks havoc on custom themes (like mine) that rely on functions like get_cat_name that take a category ID as a variable:

    <?php get_cat_name( $cat_id ) ?>

    I think I fixed it by doing the following:
    1. go to wp_1_terms table and edit term_id back to original term_id
    2. go to wp_1_term_taxonomy and edit term_id back to original term_id
    3. I have the "custom permalink" plugin, so I had to go reassign the custom permalink for the category

    You would obviously replace "wp_1_terms" with whichever blog was affected ("wp_3_terms" for example)

    I hope this info helps somebody out there. For the future, is there any way to prevent this "not bug" behavior of reassigning category ID every time you change a category name? Thanks!

  9. texet
    Member
    Posted 15 years ago #

    I also want to apologize in advance if my advice breaks some key feature of WPMU that I am not aware of yet.

  10. r-a-y
    Member
    Posted 15 years ago #

    I'm getting a similar problem, but slightly different.

    When I edit or rename a category and save it, another term_id's name (could be a tag name or category name) takes its place instead of the just-edited category name.

    The problem is the term_id doesn't match the term_taxonomy_id; the term_id seems to be incrementing at a different auto index.

    So what I have to do is manually go into PHPMyAdmin and alter the wp_1_term_taxonomy table so the term_id matches the term_taxonomy_id in question.

    I have to do this every time I want to make a change to a category.

    I've taken a screenshot and annotated what I believe is causing the problem:
    http://i29.tinypic.com/2noexf.png

    Please take a look and give me an idea of how I might be able to fix the problem.

    Thanks in advance!

  11. DeannaS
    Member
    Posted 15 years ago #

    I can't replicate this behavior.... Can you give specific steps that cause it? Is this all within the same blog? Or, are you going cross blogs? Are you seeing it in the front end? Or do you have to go into the database to see the funkiness?

About this Topic

  • Started 15 years ago by webmatter
  • Latest reply from DeannaS