Modify the code on taxonomy.module to defend against duplicate for array $terms.
This avoid mysql error message when editing a node.
Function taxonomy_node_save
if (is_array($terms)) {
foreach ($terms as $term) {
if (is_array($term)) {
foreach ($term as $tid) {
if ($tid) {
$typed_term_tid = $tid;
if (!isset($inserted[$typed_term_tid])) {
db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $tid);
$inserted[$typed_term_tid] = TRUE;
}
}
}
}
else if (is_object($term)) {
$typed_term_tid = $term->tid;
if (!isset($inserted[$typed_term_tid])) {
db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $term->tid);
$inserted[$typed_term_tid] = TRUE;
}
}
else if ($term) {
$typed_term_tid = $term;
if (!isset($inserted[$typed_term_tid])) {
db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $term);
$inserted[$typed_term_tid] = TRUE;
}
}
}
}
Comments
Comment #1
drummSee http://drupal.org/patch/create for information on how to create a properly-formed patch. I am a bit confused by the problem description. How can this bug be reproduced?
Comment #2
dpearcefl commentedConsidering the time elapsed between now and the last comment plus the fact that D5 is no longer supported, I am closing this ticket.