Index: taxonomy_breadcrumb.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 taxonomy_breadcrumb.inc
--- taxonomy_breadcrumb.inc	31 May 2009 19:37:18 -0000	1.1.2.3
+++ taxonomy_breadcrumb.inc	9 Oct 2009 03:52:56 -0000
@@ -7,38 +7,28 @@
  */
 
 /**
- * This function overrides the core taxonomy_term_page.  First, call the core
- * taxonomy_term_page.  Then, alter the breadcrumb trail.  This module's
- * hook_menu and a module weight greater than taxonomy's ensure this
- * function gets called for the taxonomy/term path (the module weight is
- * in the system table and is set in taxonomy_breadcrumb.install).
- */
-function _taxonomy_breadcrumb_term_page($str_tids = '', $depth = 0, $op = 'page') {
-  static $callback = array();
-  if (empty($callback)) {
-    $callback = variable_get('taxonomy_breadcrumb_override_callback', array() );
-    if (!empty($callback)) {
-      $require_path = isset($callback['file path']) ? $callback['file path'] : drupal_get_path('module', $callback['module']);
-      require_once($require_path .'/'. $callback['file']);
-    }
-    else {
-      // Default to core taxonomy_term_page callback.
-      // Include the .inc file with all helper functions.
-      require_once(drupal_get_path('module', 'taxonomy') .'/taxonomy.pages.inc');
-    }
-  }
-  if (isset($callback['page callback'])) {
-    $func = $callback['page callback'];
-    // Assume that any function overriding the core taxonomy function would have the same parameters.
-    $output = $func($str_tids, $depth, $op);
-  }
-  else {
-    // Call the core taxonomy_term_page function.
-    $output = taxonomy_term_page($str_tids, $depth, $op);
-  }
-
+ * Set a Taxonomy breadcrumb and call the original taxonomy/term/% callback.
+ *
+ * @param $tid
+ *   The TID of the term to call a callback for.
+ * @param $callback
+ *   The name of the original callback function.
+ * @param $file
+ *   The file the original term callback is in.
+ * @param $filepath
+ *   The path to $file.
+ * @param ...
+ *   Additional arguments to pass on to the callback.
+ *
+ * @ return
+ *   The return value of the original callback function.
+ */
+function _taxonomy_breadcrumb_term_page($tid, $callback, $file, $filepath) {
+  require_once($filepath .'/'. $file);
+  $arguments = array_slice(func_get_args(), 4);
+  $output =  call_user_func_array($callback, $arguments);
   // Use first term to generate breadcrumb trail.
-  $terms = taxonomy_terms_parse_string($str_tids);
+  $terms = taxonomy_terms_parse_string($tid);
   $breadcrumb = _taxonomy_breadcrumb_generate_breadcrumb($terms['tids'][0], TRUE);
   drupal_set_breadcrumb($breadcrumb);
   return $output;
Index: taxonomy_breadcrumb.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.module,v
retrieving revision 1.7.2.2
diff -u -r1.7.2.2 taxonomy_breadcrumb.module
--- taxonomy_breadcrumb.module	24 Apr 2009 02:51:41 -0000	1.7.2.2
+++ taxonomy_breadcrumb.module	9 Oct 2009 03:52:21 -0000
@@ -89,13 +89,21 @@
 /**
  * Implementation of hook_menu_alter().
  */
-function taxonomy_breadcrumb_menu_alter(&$callbacks) {
-  // Defined by taxonomy, but might be modified by another module.
-  $existing_callback = $callbacks['taxonomy/term/%'];
-  variable_set('taxonomy_breadcrumb_override_callback', $existing_callback);
-  $callbacks['taxonomy/term/%']['page callback'] = '_taxonomy_breadcrumb_term_page';
-  $callbacks['taxonomy/term/%']['file'] = 'taxonomy_breadcrumb.inc';
-  $callbacks['taxonomy/term/%']['file path'] = drupal_get_path('module', 'taxonomy_breadcrumb');
+function taxonomy_breadcrumb_menu_alter(&$items) {
+  if (isset($items['taxonomy/term/%']['page callback'])) {
+    $item = &$items['taxonomy/term/%'];
+    // Store the original configuration, so we can pass it on to our own callback.
+    $callback = $item['page callback'];
+    $arguments = $item['page arguments'];
+    $file = $item['file'];
+    $filepath = isset($item['file path']) ? $item['file path'] : drupal_get_path('module', $item['module']);
+
+    // Alter the original callback.
+    $item['page callback'] = '_taxonomy_breadcrumb_term_page';
+    $item['page arguments'] = array_merge(array(2, $callback, $file, $filepath), $arguments);
+    $item['file'] = 'taxonomy_breadcrumb.inc';
+    $item['file path'] = drupal_get_path('module', 'taxonomy_breadcrumb');
+  }
 }
 
 /**
