diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-01-04 06:20:30 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-01-04 06:20:30 +0000 |
commit | bf17062f5b0394d11ad4c41433099d83995c0d23 (patch) | |
tree | 6b7241a7353bbaff89d26c00d6770c2b9e405f4f /includes/menu.inc | |
parent | 6cff2ebdfe8efc4f3a206fc68f798776736b17b0 (diff) | |
download | brdo-bf17062f5b0394d11ad4c41433099d83995c0d23.tar.gz brdo-bf17062f5b0394d11ad4c41433099d83995c0d23.tar.bz2 |
- Patch #1014096 by chx: don't load schema on every page view.
Diffstat (limited to 'includes/menu.inc')
-rw-r--r-- | includes/menu.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/menu.inc b/includes/menu.inc index 1a54f1594..0806a31cf 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -2379,13 +2379,15 @@ function menu_link_get_preferred($path = NULL) { $query->leftJoin('menu_router', 'm', 'm.path = ml.router_path'); $query->fields('ml'); // Weight must be taken from {menu_links}, not {menu_router}. - $query->fields('m', array_diff(drupal_schema_fields_sql('menu_router'), array('weight'))); + $query->addField('ml', 'weight', 'link_weight'); + $query->fields('m'); $query->condition('ml.menu_name', $menu_names, 'IN'); $query->condition('ml.link_path', $path_candidates, 'IN'); // Sort candidates by link path and menu name. $candidates = array(); foreach ($query->execute() as $candidate) { + $candidate['weight'] = $candidate['link_weight']; $candidates[$candidate['link_path']][$candidate['menu_name']] = $candidate; } @@ -2505,9 +2507,11 @@ function menu_link_load($mlid) { $query->leftJoin('menu_router', 'm', 'm.path = ml.router_path'); $query->fields('ml'); // Weight should be taken from {menu_links}, not {menu_router}. - $query->fields('m', array_diff(drupal_schema_fields_sql('menu_router'), array('weight'))); + $query->addField('ml', 'weight', 'link_weight'); + $query->fields('m'); $query->condition('ml.mlid', $mlid); if ($item = $query->execute()->fetchAssoc()) { + $item['weight'] = $item['link_weight']; _menu_link_translate($item); return $item; } |