#12206 closed defect (bug) (invalid)
WPMU: Category ID changes when updating a category name
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9.1 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
Running WPMU 2.9.1 and have reproduced this on a fresh install as well as an upgraded site.
If you click EDIT on any category and update the name it will be assigned the next available ID when saved. This happens whether posts are assigned to this category or not.
This was also discussed on the Hackers Mailing list on 1/27
Change History (7)
#2
@
15 years ago
This is by design? What if you are using is_category('5') in your theme template and then the category ID is updated? Your theme wouldn't work correctly.
I'm a little confused why this would be by design. If I have category with ID 5 how can another blog use that category?
#3
@
15 years ago
An example:
The category "test" on blog 1 will have the same cat_ID as the same category on blog 2. Rename that category to "test2" on one blog, and the other blog will still have a category called test with the old cat_ID.
test2's cat_ID will be different though.
cat_IDs are global across all blogs, makes doing things like sitewide tags much easier!
You can always do is_category( 'test' )
The cat_ID is supposed to update because all categories are global, but it probably shouldn't be incremented by one. It should get a random number above the count of categories in sitecategories.
It updates because another blog on your system may have used that category and cat_ID. It should also update the categories of the affected posts. If it doesn't then that's a bug.