[wpmu-trac] [WordPress MU Trac] #580: In certain conditions, writing a post will cause a category to inadvertantly be created

WordPress MU Trac wpmu-trac at lists.automattic.com
Thu Mar 27 18:25:20 GMT 2008


#580: In certain conditions, writing a post will cause a category to
inadvertantly be created
------------------------+---------------------------------------------------
 Reporter:  MrBrian     |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  high        |   Milestone:          
Component:  component1  |     Version:          
 Severity:  major       |    Keywords:          
------------------------+---------------------------------------------------
 I noticed a a few of my bloggers with categories called "1", so i had to
 look into it. What i noticed is a bug when the default category is
 changed, saving a post without choosing a category for it will cause a
 category named 1 to be created in the category list. To reproduce, rename
 the "Uncategorized" category to something else, which will cause the ID to
 change. Now go and write a post and don't select a category. Hit save or
 publish. Then go and take a look at the Categories list and you'll see it
 created a category called "1". Deleting the category will also delete the
 post.

 Taking a look at the code, i believe it has to do with the
 'default_category' value in every blog's options table. Inside
 wp_insert_post() function it says if there's no category selected, use the
 'default_category' value from the options table. The problem is this ID of
 1 doesn't exist anymore, because when you modify the "Uncategorized"
 category the ID changes.

 I'm guessing to fix this, either the 'default_value' option should be
 updated, or by making sure there exists a term_id of 1 at all times.

-- 
Ticket URL: <http://trac.mu.wordpress.org/ticket/580>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser


More information about the wpmu-trac mailing list