[wp-trac] Re: [WordPress Trac] #8877: dotclear import don't set the post category

WordPress Trac wp-trac at lists.automattic.com
Thu Jun 11 15:33:09 GMT 2009


#8877: dotclear import don't set the post category
--------------------------+-------------------------------------------------
 Reporter:  olivM         |       Owner:  westi        
     Type:  defect (bug)  |      Status:  accepted     
 Priority:  low           |   Milestone:  2.9          
Component:  Import        |     Version:               
 Severity:  normal        |    Keywords:  needs-testing
--------------------------+-------------------------------------------------
Changes (by Denis-de-Bernardy):

  * priority:  high => low
  * milestone:  Future Release => 2.9


Old description:

> when importing from dotclear, all the posts are set only to the default
> category.
>
> i think the problem is due to the fact that wp_set_post_categories do
> nothing if we pass it only one category (don't know why...)
>
> ( in /wp-admin/import/dotclear.php, line 479 )
> {{{
>                                 // Make Post-to-Category associations
>                                 $cats = array();
>                                 $category1 =
> get_category_by_slug($post_cat_name);
>                                 $category1 = $category1->term_id;
> }}}
>
> should be
> {{{
>                                 // Make Post-to-Category associations
>                                 $cats =
> array(get_option('default_category'));
>                                 $category1 =
> get_category_by_slug($post_cat_name);
>                                 $category1 = $category1->term_id;
>
> }}}

New description:

 when importing from dotclear, all the posts are set only to the default
 category.

 i think the problem is due to the fact that wp_set_post_categories do
 nothing if we pass it only one category (don't know why...)

 ( in /wp-admin/import/dotclear.php, line 479 )
 {{{
                                 // Make Post-to-Category associations
                                 $cats = array();
                                 $category1 =
 get_category_by_slug($post_cat_name);
                                 $category1 = $category1->term_id;
 }}}

 should be
 {{{
                                 // Make Post-to-Category associations
                                 $cats =
 array(get_option('default_category'));
                                 $category1 =
 get_category_by_slug($post_cat_name);
                                 $category1 = $category1->term_id;

 }}}

--

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/8877#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list