diff -rupw /home/matt/Work/greenmaps/patched-modules/taxonomy_limit/taxonomy_limit.info taxonomy_limit/taxonomy_limit.info
--- /home/matt/Work/greenmaps/patched-modules/taxonomy_limit/taxonomy_limit.info	2007-01-30 00:55:01.000000000 -0500
+++ taxonomy_limit/taxonomy_limit.info	2009-05-20 12:25:34.000000000 -0400
@@ -1,8 +1,8 @@
 ; $Id: taxonomy_limit.info,v 1.1 2007/01/04 05:46:47 codexmas Exp $
 name = Taxonomy Limit
 description = Allows the restriction of the number of terms selected in a vocabulary.
-
-; Information added by drupal.org packaging script on 2007-01-30
-version = "5.x-1.2"
-project = "taxonomy_limit"
-
+dependencies[] = taxonomy
+core = 6.x
+version = 6.x-0.1
+project = taxonomy_limit
+package = Taxonomy Limit
diff -rupw /home/matt/Work/greenmaps/patched-modules/taxonomy_limit/taxonomy_limit.install taxonomy_limit/taxonomy_limit.install
--- /home/matt/Work/greenmaps/patched-modules/taxonomy_limit/taxonomy_limit.install	2007-01-04 11:21:32.000000000 -0500
+++ taxonomy_limit/taxonomy_limit.install	2009-05-20 12:51:21.000000000 -0400
@@ -2,6 +2,10 @@
 // $Id: taxonomy_limit.install,v 1.1.2.2 2007/01/04 16:21:32 codexmas Exp $
 
 /**
+ * @file taxonomy_limit.install
+ */
+
+/**
  * Implementation of hook_install().
  */
 function taxonomy_limit_install() {
diff -rupw /home/matt/Work/greenmaps/patched-modules/taxonomy_limit/taxonomy_limit.module taxonomy_limit/taxonomy_limit.module
--- /home/matt/Work/greenmaps/patched-modules/taxonomy_limit/taxonomy_limit.module	2007-01-30 00:51:46.000000000 -0500
+++ taxonomy_limit/taxonomy_limit.module	2009-05-21 12:47:50.000000000 -0400
@@ -1,17 +1,21 @@
 <?php
 // $Id: taxonomy_limit.module,v 1.5.2.2 2007/01/30 05:51:46 codexmas Exp $
 
+/*
+  $terms[$vid] = taxonomy_get_children(NULL, $vid);
+  $vocabs = taxonomy_get_vocabularies($type);
+*/
+
 /**
 * @desc Menu hook
 */
-function taxonomy_limit_menu($may_cache){
-  $items[] = array(
-    'path'                => 'admin/settings/taxonomy_limit',
-    'title'               => t('Taxonomy Limit'),
-    'description'         => t('Limit terms selected in a vocabulary.'),
-    'callback'            => 'drupal_get_form',
-    'callback arguments'  => 'taxonomy_limit_settings',
-    'access'              => user_access('administer site configuration'),
+function taxonomy_limit_menu() {
+  $items['admin/settings/taxonomy_limit'] = array(
+    'title'               => 'Taxonomy Limit',
+    'description'         => 'Limit terms selected in a vocabulary.',
+    'page callback'       => 'drupal_get_form',
+    'page arguments'      => array('taxonomy_limit_settings'),
+    'access arguments'    => array('administer taxonomy'),
     'type'                => MENU_NORMAL_ITEM,
   );
   
@@ -23,26 +27,36 @@ function taxonomy_limit_menu($may_cache)
 * form level, not the element level.  It also appends the description
 * of the category to provide a useful hint on the limit.
 */
-function taxonomy_limit_form_alter($form_id, &$form) {
-	if ($form['type']) {
-		// Get the content types we are allowed to work with
-		if($limit_types = variable_get('taxonomy_limit_types', NULL)){
-		  $type = $form['#node']->type;
-		  // Is this a type that has been selected?
-		  if ($limit_types[$type].'_node_form' == $form_id) {
+function taxonomy_limit_form_alter(&$form, $form_state, $form_id) {
+  // Make sure this form is for editing a node
+  if (!($form['type'] && is_array($form['type']) && $form['type']['#value'])) {
+    return;
+  }
+  // Get the content types we are allowed to work with, if set
+  if (!$limit_types = variable_get('taxonomy_limit_types', NULL)) {
+    return;
+  }
+  // Is this a node type that has been selected?
+  if ($limit_types[$form['#node']->type] .'_node_form' != $form_id) {
+    return;
+  }
+
 			  // Load the validation data for the content type
-			  if($tax_limit = variable_get('taxonomy_limit_'.$type, NULL)){
+  if ($tax_limit = variable_get('taxonomy_limit_'. $form['#node']->type, NULL)) {
 			    $validate = FALSE;
 			    // Go through each configured category
 			    foreach($tax_limit AS $vid => $data){
 				    $max = $data['max'];
 				    // Only allow numbers greater than zero (disabled)
-				    if(is_numeric($max) AND $max > 0){
+      if (!(is_numeric($max) && $max > 0)) {
+        continue;
+      }
 					    // Validate that this category still meets the criteria
-              $dummy = array(0 => 0);
-					    if(taxonomy_limit_validate_vocabulary($vid, $dummy)){
-						    $validate .= "$vid,$max|";
-                $desc = t(" <strong>(Choose up to ".taxonomy_limit_number($max).")</strong>");
+      if (taxonomy_limit_validate_vocabulary($vid)) {
+        $validate = TRUE;
+        $desc = " <strong>".
+          t("(Choose up to @max)", array("@max" => taxonomy_limit_number($max)))
+          ."</strong>";
                 if(is_array($form['taxonomy']['tags'][$vid])){
                   $form['taxonomy']['tags'][$vid]['#description'] .= $desc; 
                 }
@@ -51,13 +65,9 @@ function taxonomy_limit_form_alter($form
                 }
 					    }
 				    }
-			    }
-			    // Only set the validation for categories that are configured.
+    // Only set validation callback if limits have been set.
 			    if($validate){
-				    $form['#validate']['taxonomy_limit_validate_max_terms'] = array('all' => $validate);
-			    }
-        }
-		  }
+      $form['#validate'][] = '_taxonomy_limit_validate_max_terms';
     }
 	}
 }
@@ -67,53 +77,59 @@ function taxonomy_limit_form_alter($form
 * We are passed the $all string, which is a concatenated vid/max series of entries
 * seperated by a single pipe.
 */
-function taxonomy_limit_validate_max_terms($form_id, $edit, $form, $all) {
-	// Fetch all limits for vocabs
-  $type = $form['#node']->type;
-  $tax_limit = variable_get('taxonomy_limit_'.$type, NULL);
-  $items = explode('|', $all);  // eg: vid,max|vid,max|vid,max
+//function _taxonomy_limit_validate_max_terms($form_id, $edit, $form, $all) {
+function _taxonomy_limit_validate_max_terms($form, &$form_state) {
+  // Fetch all limits for vocabs for this type
+  $tax_limit = variable_get('taxonomy_limit_'. $form['#node']->type, NULL);
   // Loop through all the vocabulary validation items
-  foreach($items AS $items => $data){
-		if(strstr($data, ',')){   
-			$parts = explode(',', $data); // eg: vid,max
-			$vid = $parts[0];
-			$max = $parts[1];
+  foreach ($tax_limit AS $vid => $data) {
+    $max = $data['max'];
+    // Only allow numbers greater than zero (disabled)
+    if (!(is_numeric($max) && $max > 0)) {
+      continue;
+    }
       // Validate once again that this vid meets the criteria
-      if($valid = taxonomy_limit_validate_vocabulary($vid, $terms)){
+    if (!taxonomy_limit_validate_vocabulary($vid)) {
+      continue;
+    }
         // Create error message
         if($tax_limit[$vid]['error']){
+      // TODO use hook_locale() here; calling t() on user input is incorrect
 					$error = t($tax_limit[$vid]['error']);
 				}
 				else{
-					$vocab = taxonomy_get_vocabulary($vid);
-					$error = t('Too many terms selected for ').$vocab->name;
+      // default error message
+      $vocab = taxonomy_vocabulary_load($vid);
+      $error = t('Too many terms selected for @name', array('@name' => $vocab->name));
 				}
         // After node has been saved, and is being edited...
-        if($tags = $edit['taxonomy']['tags'][$vid]){
+    if ($tags = $form['taxonomy']['tags'][$vid]['#value']) {
           if(count(explode(',', $tags)) > $max){
             form_set_error("taxonomy][tags][$vid", $error);
           }
         }
         // Non freetagging vocabulary
-				if (sizeof($edit['taxonomy'][$vid]) > $max) {
+    if (sizeof($form['taxonomy'][$vid]['#value']) > $max) {
 					form_set_error("taxonomy][$vid", $error);
 				}
 			}
 		}
-	}
-}
 
-function taxonomy_limit_validate_vocabulary(&$vid, &$terms){
+function taxonomy_limit_validate_vocabulary(&$vid, &$terms = array()) {
 	// Were we passed a vid?
-  if(is_numeric($vid)){
-		$vocab = taxonomy_get_vocabulary($vid);
+  if (!is_numeric($vid)) {
+    return FALSE;
+  }
+  $vocab = taxonomy_vocabulary_load($vid);
 		// did the vocab load properly?
-		if(is_object($vocab)){
-			// Must be multiple
+  if (!is_object($vocab)) {
+    return FALSE;
+  }
+  // must allow multiple selections
 			if(!$vocab->multiple){
 				return FALSE;
 			}
-			// Indicate that this is a freetagging vocab, and populates the $terms by ref
+  // indicate that this is a freetagging vocab, and populates the $terms by ref
 			if($vocab->tags){
         if(!$terms[$vid]){
           $terms[$vid] = taxonomy_get_children(NULL, $vid);
@@ -122,9 +138,6 @@ function taxonomy_limit_validate_vocabul
 			// All good, allow this category
 			return TRUE;
 		}
-	}
-	return FALSE;
-}
 
 function taxonomy_limit_settings(){
 	drupal_add_css(drupal_get_path('module', 'taxonomy_limit').'/style.css');
@@ -133,17 +146,20 @@ function taxonomy_limit_settings(){
 	$form['taxonomy_limit_types'] = array(
 		'#type'           => 'checkboxes',
 		'#options'        => $types,
-		'#title'          => t('Apply to content-type'),
+    '#title'          => t('Apply to content type'),
 		'#default_value'  => $limit_types,
-		'#description'    => t("Only vocabularies that have the multiple option enabled are affected by this module.<br />Freetagging categories are also not supported.<br />"
-		."<br /><em>Setting a maximum of <strong>zero</strong> for a category will disable the maximum check.</em>"),
+    '#description'    =>
+      t("Only vocabularies that have the multiple option enabled are affected by this module.")
+      ."<br /><br /><em>".
+      t("Setting a maximum of <strong>zero</strong> for a category will disable the maximum check.")
+      ."</em>",
 	);
 	if($limit_types){
 		foreach($limit_types AS $key => $type){
 			if(!is_numeric($type)){
 				$form['settings']['taxonomy_limit_types']['taxonomy_limit_'.$type] = array(
 					'#type'   => 'fieldset',
-					'#title'  => t('Maximum number of terms for <strong>'.$type.'</strong> content-type'),
+          '#title'  => t('Maximum number of terms for %type content type', array('%type' => $type)),
 					'#tree'   => TRUE,
 				);
 				$vocabs = taxonomy_get_vocabularies($type);
@@ -158,7 +174,7 @@ function taxonomy_limit_settings(){
 						}
 						$form['settings']['taxonomy_limit_types']['taxonomy_limit_'.$type][$vid]['max'] = array(
 							'#prefix'         => '<div class="taxonomy_limit_types">',
-							'#title'          => t($vocab->name),
+              '#title'          => $vocab->name,
 							'#type'           => 'textfield',
 							'#size'           => 4,
 							'#default_value'  => $tax_limit[$vid]['max'] ? $tax_limit[$vid]['max'] : '',
@@ -173,13 +189,15 @@ function taxonomy_limit_settings(){
 					}
 					if($invalid_count == count($vocabs)){
 						$form['settings']['taxonomy_limit_types']['taxonomy_limit_'.$type][$vid] = array(
-							'#value' => t('None of the vocabularies defined for this content-type are valid.<br />'),
+              '#value' => t('None of the vocabularies defined for this content type are valid.')
+              .'<br />',
 						);
 					}
 				}
 				else{
 						$form['settings']['taxonomy_limit_types']['taxonomy_limit_'.$type][$vid] = array(
-							'#value' => t('There are no vocabularies defined for this content-type.<br />'),
+              '#value' => t('There are no vocabularies defined for this content type.')
+              .'<br />',
 						);
 
 				}
@@ -191,26 +209,27 @@ function taxonomy_limit_settings(){
 
 function taxonomy_limit_number($number){
 	$numbers = array(
-		1   => 'one',
-		2   => 'two',
-		3   => 'three',
-		4   => 'four',
-		5   => 'five',
-		6   => 'six',
-		7   => 'seven',
-		8   => 'eight',
-		9   => 'nine',
-		10  => 'ten',
-		11  => 'eleven',
-		12  => 'twelve',
-		13  => 'thirteen',
-		14  => 'fourteen',
-		15  => 'fifteen',
-		16  => 'sixteen',
-		17  => 'seventeen',
-		18  => 'eighteen',
-		19  => 'nineteen',
-		20  => 'twenty',
+    0   => t('zero'),
+    1   => t('one'),
+    2   => t('two'),
+    3   => t('three'),
+    4   => t('four'),
+    5   => t('five'),
+    6   => t('six'),
+    7   => t('seven'),
+    8   => t('eight'),
+    9   => t('nine'),
+    10  => t('ten'),
+    11  => t('eleven'),
+    12  => t('twelve'),
+    13  => t('thirteen'),
+    14  => t('fourteen'),
+    15  => t('fifteen'),
+    16  => t('sixteen'),
+    17  => t('seventeen'),
+    18  => t('eighteen'),
+    19  => t('nineteen'),
+    20  => t('twenty'),
 	);
 	// Return the original number if we don't have it in the list.
 	if(!$numbers[$number]){
