Make WordPress Core

Opened 16 years ago

Closed 14 years ago

#5372 closed defect (bug) (fixed)

Wrong category on post insertion

Reported by: malaiac's profile malaiac Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

in wp-includes/taxonomy.php

function = wp_set_object_terms

around lines 1013,1014

<?php

$term_ids[] = $idterm_id?;

$id = $idterm_taxonomy_id?;

?>

bug : when $id is not an array, it resets $id to 1 (i can't figure why)... and the post is assigned to the wrong (1) category, instead of the legit category.

Happens when the post category is new (has just been created)

Found when doing a custom import

Change History (2)

#1 @ryan
16 years ago

Current trunk adds an is_wp_error() check on $id.

http://trac.wordpress.org/browser/trunk/wp-includes/taxonomy.php#L1141

2.3.1 lacks this check, which could explain the bad id.

#2 @Denis-de-Bernardy
14 years ago

  • Milestone 2.9 deleted
  • Resolution set to fixed
  • Status changed from new to closed

please re-open if still occurring

Note: See TracTickets for help on using tickets.