Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.348 diff -u -p -r1.348 menu.inc --- includes/menu.inc 1 Oct 2009 19:07:12 -0000 1.348 +++ includes/menu.inc 1 Oct 2009 21:53:16 -0000 @@ -907,8 +907,8 @@ function menu_tree_all_data($menu_name, // Use $mlid as a flag for whether the data being loaded is for the whole tree. $mlid = isset($link['mlid']) ? $link['mlid'] : 0; - // Generate a cache ID (cid) specific for this $menu_name, $item, and depth. - $cid = 'links:' . $menu_name . ':all-cid:' . $mlid . ':' . (int)$max_depth; + // Generate a cache ID (cid) specific for this $menu_name, $link, $language, and depth. + $cid = 'links:' . $menu_name . ':all-cid:' . $mlid . ':' . $GLOBALS['language']->language . ':' . (int)$max_depth; if (!isset($tree[$cid])) { // If the static variable doesn't have the data, check {cache_menu}. @@ -926,6 +926,7 @@ function menu_tree_all_data($menu_name, // Build the query using a LEFT JOIN since there is no match in // {menu_router} for an external link. $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC)); + $query->addTag('menu_links'); $query->leftJoin('menu_router', 'm', 'm.path = ml.router_path'); $query->fields('ml'); $query->fields('m', array( @@ -1018,7 +1019,7 @@ function menu_tree_page_data($menu_name, $max_depth = min($max_depth, MENU_MAX_DEPTH); } // Generate a cache ID (cid) specific for this page. - $cid = 'links:' . $menu_name . ':page-cid:' . $item['href'] . ':' . (int)$item['access'] . ':' . (int)$max_depth; + $cid = 'links:' . $menu_name . ':page-cid:' . $item['href'] . ':' . $GLOBALS['language']->language . ':' . (int)$item['access'] . ':' . (int)$max_depth; if (!isset($tree[$cid])) { // If the static variable doesn't have the data, check {cache_menu}. @@ -1109,6 +1110,7 @@ function menu_tree_page_data($menu_name, // LEFT JOIN since there is no match in {menu_router} for an external // link. $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC)); + $query->addTag('menu_links'); $query->leftJoin('menu_router', 'm', 'm.path = ml.router_path'); $query->fields('ml'); $query->fields('m', array( @@ -1164,7 +1166,7 @@ function menu_tree_page_data($menu_name, * Helper function - compute the real cache ID for menu tree data. */ function _menu_tree_cid($menu_name, $data) { - return 'links:' . $menu_name . ':tree-data:' . md5(serialize($data)); + return 'links:' . $menu_name . ':tree-data:' . $GLOBALS['language']->language . ':' . md5(serialize($data)); } /** Index: includes/database/select.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database/select.inc,v retrieving revision 1.24 diff -u -p -r1.24 select.inc --- includes/database/select.inc 18 Sep 2009 00:04:21 -0000 1.24 +++ includes/database/select.inc 2 Oct 2009 00:13:42 -0000 @@ -1285,6 +1285,11 @@ class SelectQuery extends Query implemen // FIELDS and EXPRESSIONS $fields = array(); + foreach ($this->tables as $alias => $table) { + if (!empty($table['all_fields'])) { + $fields[] = $alias . '.*'; + } + } foreach ($this->fields as $alias => $field) { // Always use the AS keyword for field aliases, as some // databases require it (e.g., PostgreSQL). @@ -1293,11 +1298,6 @@ class SelectQuery extends Query implemen foreach ($this->expressions as $alias => $expression) { $fields[] = $expression['expression'] . ' AS ' . $expression['alias']; } - foreach ($this->tables as $alias => $table) { - if (!empty($table['all_fields'])) { - $fields[] = $alias . '.*'; - } - } $query .= implode(', ', $fields);