Index: modules/simpletest/tests/taxonomy_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/taxonomy_test.module,v retrieving revision 1.1 diff -u -p -r1.1 taxonomy_test.module --- modules/simpletest/tests/taxonomy_test.module 2 Nov 2008 14:42:45 -0000 1.1 +++ modules/simpletest/tests/taxonomy_test.module 2 Nov 2008 17:23:45 -0000 @@ -14,19 +14,27 @@ function taxonomy_test_taxonomy_term_loa } /** - * Implementation of hook_taxonomy_term_save(). + * Implementation of hook_taxonomy_term_insert(). */ -function taxonomy_test_taxonomy_term_save($term) { +function taxonomy_test_taxonomy_term_insert($term) { + if (!empty($term->antonyms)) { + foreach (explode ("\n", str_replace("\r", '', $term->antonyms)) as $antonym) { + if ($antonym) { + db_insert('term_antonym')->fields(array('tid' => $term->tid, 'name' => rtrim($antonym)))->execute(); + } + } + } +} + +/** + * Implementation of hook_taxonomy_term_update(). + */ +function taxonomy_test_taxonomy_term_update($term) { taxonomy_test_taxonomy_term_delete($term); if (!empty($term->antonyms)) { foreach (explode ("\n", str_replace("\r", '', $term->antonyms)) as $antonym) { if ($antonym) { - db_insert('term_antonym') - ->fields(array( - 'tid' => $term->tid, - 'name' => rtrim($antonym), - )) - ->execute(); + db_insert('term_antonym')->fields(array('tid' => $term->tid, 'name' => rtrim($antonym)))->execute(); } } } Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.435 diff -u -p -r1.435 taxonomy.module --- modules/taxonomy/taxonomy.module 2 Nov 2008 14:42:45 -0000 1.435 +++ modules/taxonomy/taxonomy.module 2 Nov 2008 17:23:48 -0000 @@ -327,7 +327,7 @@ function taxonomy_save_term(&$form_value if (!empty($form_values['tid']) && $form_values['name']) { $status = drupal_write_record('term_data', $form_values, 'tid'); - module_invoke_all('taxonomy_term_save', $term); + module_invoke_all('taxonomy_term_insert', $term); } elseif (!empty($form_values['tid'])) { return taxonomy_del_term($form_values['tid']); @@ -335,7 +335,7 @@ function taxonomy_save_term(&$form_value else { $status = drupal_write_record('term_data', $form_values); $term->tid = $form_values['tid']; - module_invoke_all('taxonomy_term_save', $term); + module_invoke_all('taxonomy_term_update', $term); } db_query('DELETE FROM {term_relation} WHERE tid1 = %d OR tid2 = %d', $form_values['tid'], $form_values['tid']);