diff -upN taxonomy_batch_operations.old/taxonomy_batch_operations.module taxonomy_batch_operations.new/taxonomy_batch_operations.module
--- taxonomy_batch_operations.old/taxonomy_batch_operations.module	2007-02-14 03:55:52.000000000 +0100
+++ taxonomy_batch_operations.new/taxonomy_batch_operations.module	2008-02-07 23:42:53.000000000 +0100
@@ -1,5 +1,7 @@
 <?php
 
+// $Id$
+
 function taxonomy_batch_operations_help($section) {
   switch ($section) {
     case 'admin/modules#description':
@@ -115,8 +117,8 @@ function taxonomy_batch_operations_overv
       '#default_value' => $term->weight,
     );
     $form['multiedit'][$term->tid]['operations'] = array(
-      '#value' => l(t('edit'), "admin/taxonomy/edit/term/$term->tid", array(), $destination) . ' | ' .
-                  l(t('delete'), "admin/taxonomy/delete/term/$term->tid", array(), $destination),
+      '#value' => l(t('edit'), "admin/content/taxonomy/edit/term/$term->tid", array(), $destination) . ' | ' .
+                  l(t('delete'), "admin/content/taxonomy/delete/term/$term->tid", array(), $destination),
     );
     $form['multiedit'][$term->tid]['check'] = array(
       '#type' => 'checkbox',
@@ -229,17 +231,18 @@ function taxonomy_term_confirm_multiple_
 
   drupal_Set_message(t('Deleted multiple terms'));
 
-  return 'admin/content/taxonomy/';
+  return $_GET['destination'];
 }  
 
 function batch_operations_form_validate($form_id, $form_values) {
 }
 
 function taxonomy_batch_operations_form_submit($form_id, $form_values) {
-  switch ($_POST[op]) {
-    case 'Save':
+  switch ($form_values['op']) {
+    case t('Save'):
       foreach ($form_values[multiedit] as $key => $tid) {
         $term = taxonomy_get_term($key);
+	$parents = taxonomy_get_parents($key);
         unset($tid['check']);
         $tid['tid'] = $term->tid; 
         $tid['name'] = $term->name;
@@ -247,18 +250,18 @@ function taxonomy_batch_operations_form_
         $tid['synonyms'] = $term->synonyms;
         // weight is already set
         $tid['vid'] = $term->vid;
-        $tid['parent'] = $term->parent;
+        $tid['parent'] = array_keys($parents);
 
         taxonomy_save_term($tid);
       }
       drupal_set_message(t('Updated term weights'));
       break;
-    case 'Delete Selected':
+    case t('Delete Selected'):
       foreach ($form_values[multiedit] as $key => $tid) {
         if ($tid['check'] == 1)
           $tids[] = $key;
       }
-      return "admin/taxonomy/delete/terms/".implode($tids, ',');       
+      return array("admin/content/taxonomy/delete/terms/" . implode($tids, ','), drupal_get_destination());
       break;
   }
 
@@ -329,8 +332,6 @@ function taxonomy_add_multiple_terms_for
   $terms = explode("\n", $form_values['name']);
  
   foreach ($terms as $key => $term) {
-    $term = trim($term); // keep ending up with a trailing space, haven't tracked it down
-
     // strip of prefix and suffix, if necessary
     if (!empty($form_values['prefix']) && strpos($term, $form_values['prefix']) === 0)
       $term = substr($term, strlen($form_values['prefix']));
@@ -340,7 +341,7 @@ function taxonomy_add_multiple_terms_for
 
     // create our term array to pass to taxonomy_save_term
     if (trim($term) != "") {
-      $values[$key]['name'] = $term;
+      $values[$key]['name'] = trim($term);
       $values[$key]['description'] = '';
       $values[$key]['synonyms'] = '';
       $values[$key]['weight'] = 0;
@@ -364,4 +365,3 @@ function taxonomy_add_multiple_terms_for
   return 'admin/content/taxonomy';
 }
 
-?>
\ Ingen nyrad vid filslut
