Issue #805236 by merrillholt, ekl1773, marcingy, sun, catch: Cache the query in menu_local_tasks().
parent
67ad400f5d
commit
aa6235c3c3
|
@ -1926,13 +1926,21 @@ function menu_local_tasks($level = 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all tabs (also known as local tasks) and the root page.
|
// Get all tabs (also known as local tasks) and the root page.
|
||||||
|
$cid = 'local_tasks:' . $router_item['tab_root'];
|
||||||
|
if ($cache = cache_get($cid, 'cache_menu')) {
|
||||||
|
$result = $cache->data;
|
||||||
|
}
|
||||||
|
else {
|
||||||
$result = db_select('menu_router', NULL, array('fetch' => PDO::FETCH_ASSOC))
|
$result = db_select('menu_router', NULL, array('fetch' => PDO::FETCH_ASSOC))
|
||||||
->fields('menu_router')
|
->fields('menu_router')
|
||||||
->condition('tab_root', $router_item['tab_root'])
|
->condition('tab_root', $router_item['tab_root'])
|
||||||
->condition('context', MENU_CONTEXT_INLINE, '<>')
|
->condition('context', MENU_CONTEXT_INLINE, '<>')
|
||||||
->orderBy('weight')
|
->orderBy('weight')
|
||||||
->orderBy('title')
|
->orderBy('title')
|
||||||
->execute();
|
->execute()
|
||||||
|
->fetchAll();
|
||||||
|
cache_set($cid, $result, 'cache_menu');
|
||||||
|
}
|
||||||
$map = $router_item['original_map'];
|
$map = $router_item['original_map'];
|
||||||
$children = array();
|
$children = array();
|
||||||
$tasks = array();
|
$tasks = array();
|
||||||
|
|
Loading…
Reference in New Issue