=== modified file 'includes/menu.inc'
--- includes/menu.inc	2007-09-10 12:21:30 +0000
+++ includes/menu.inc	2007-09-21 10:21:37 +0000
@@ -332,18 +332,28 @@ function menu_execute_active_handler($pa
  */
 function _menu_load_objects($item, &$map) {
   if ($item['load_functions']) {
-    $load_functions = unserialize($item['load_functions']);
-    $path_map = $map;
-    foreach ($load_functions as $index => $function) {
-      if ($function) {
-        $return = $function(isset($path_map[$index]) ? $path_map[$index] : '');
-        // If callback returned an error or there is no callback, trigger 404.
-        if ($return === FALSE) {
-          $item['access'] = FALSE;
-          $map = FALSE;
-          return FALSE;
+    if ($load_functions = unserialize($item['load_functions'])) {
+      $path_map = $map;
+      foreach ($load_functions as $index => $function) {
+        if ($function) {
+          $return = $function(isset($path_map[$index]) ? $path_map[$index] : '');
+          // If callback returned an error or there is no callback, trigger 404.
+          if ($return === FALSE) {
+            $item['access'] = FALSE;
+            $map = FALSE;
+            return FALSE;
+          }
+          $map[$index] = $return;
         }
-        $map[$index] = $return;
+      }
+    }
+    else {
+      $function = $item['load_functions'];
+      $function($map);
+      // If callback returned an error, trigger 404.
+      if ($map === FALSE) {
+        $item['access'] = FALSE;
+        return FALSE;
       }
     }
   }
@@ -1273,7 +1283,7 @@ function menu_set_active_trail($new_trai
     if ($item['tab_parent']) {
       // The title of a local task is used for the tab, never the page title.
       // Thus, replace it with the item corresponding to the root path to get
-      // the relevant href and title.  For example, the menu item corresponding 
+      // the relevant href and title.  For example, the menu item corresponding
       // to 'admin' is used when on the 'By module' tab at 'admin/by-module'.
       $parts = explode('/', $item['tab_root']);
       $args = arg();
@@ -1869,6 +1879,10 @@ function _menu_router_build($callbacks) 
             $load_functions[$k] = $matches[1] .'_load';
             $match = TRUE;
           }
+          if (function_exists($matches[1] .'_menu_map')) {
+            $map_function = $matches[1] .'_menu_map';
+            $match = TRUE;
+          }
         }
       }
       if ($match) {
@@ -1887,6 +1901,10 @@ function _menu_router_build($callbacks) 
     }
     $masks[$fit] = 1;
     $item['load_functions'] = empty($load_functions) ? '' : serialize($load_functions);
+    if (isset($map_function)) {
+      $item['load_functions'] = $map_function;
+      unset($map_function);
+    }
     $item['to_arg_functions'] = empty($to_arg_functions) ? '' : serialize($to_arg_functions);
     $item += array(
       'title' => '',

