--- taxonomy.admin.inc.orig	2008-02-08 03:46:57.000000000 +0700
+++ taxonomy.admin.inc	2008-03-30 03:01:43.000000000 +0700
@@ -521,7 +521,15 @@ function taxonomy_overview_terms_submit(
 
   // Save all updated terms.
   foreach ($changed_terms as $term) {
-    taxonomy_save_term($term);
+    switch (taxonomy_save_term($term)) {
+      case NOT_SAVED_UPDATED:
+        foreach ($tree as $item) {
+          $hierarchy = ($item->tid == $term['tid'] && $item->parents[0] != 0) ? 1 : $hierarchy;
+        }
+        drupal_set_message(t('Cannot move term %term to the given location to prevent duplication.', array('%term' => $term['name'])), 'error');
+        watchdog('taxonomy', 'Cannot move term %term to the given location to prevent duplication.', array('%term' => $term['name']), WATCHDOG_NOTICE);
+        break;
+    }
   }
 
   // Update the vocabulary hierarchy to flat or single hierarchy.
@@ -745,6 +753,11 @@ function taxonomy_form_term_validate($fo
  *
  * @see taxonomy_form_term()
  */
+
+// We need some new constants to keep the same architecture
+define('NOT_SAVED_NEW', 4);
+define('NOT_SAVED_UPDATED', 5);
+ 
 function taxonomy_form_term_submit($form, &$form_state) {
   if ($form_state['clicked_button']['#value'] == t('Delete')) {
     // Execute the term deletion.
@@ -772,6 +785,14 @@ function taxonomy_form_term_submit($form
       drupal_set_message(t('Updated term %term.', array('%term' => $form_state['values']['name'])));
       watchdog('taxonomy', 'Updated term %term.', array('%term' => $form_state['values']['name']), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/term/'. $form_state['values']['tid']));
       break;
+    case NOT_SAVED_NEW:
+      drupal_set_message(t('Term %term not created to prevent duplication.', array('%term' => $form_state['values']['name'])), 'error');
+      watchdog('taxonomy', 'Term %term not created to prevent duplication.', array('%term' => $form_state['values']['name']), WATCHDOG_NOTICE);
+      return;
+    case NOT_SAVED_UPDATED:
+      drupal_set_message(t('Update on term %term aborted to prevent duplication.', array('%term' => $form_state['values']['name'])), 'error');
+      watchdog('taxonomy', 'Update on term %term aborted to prevent duplication.', array('%term' => $form_state['values']['name']), WATCHDOG_NOTICE);
+      return;
   }
 
   if (!$form['#vocabulary']['tags']) {
