Skip to content
Snippets Groups Projects
Commit f42c1f25 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #251239 by R.Muilwijk: performance improvement.

parent 21576021
No related branches found
No related tags found
No related merge requests found
......@@ -658,13 +658,15 @@ function book_build_active_trail($book_link) {
function book_nodeapi(&$node, $op, $teaser, $page) {
switch ($op) {
case 'load':
// Note - we cannot use book_link_load() because it will call node_load()
$info['book'] = db_fetch_array(db_query('SELECT * FROM {book} b INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE b.nid = %d', $node->nid));
if ($info['book']) {
$info['book']['href'] = $info['book']['link_path'];
$info['book']['title'] = $info['book']['link_title'];
$info['book']['options'] = unserialize($info['book']['options']);
return $info;
if (in_array($node->type, variable_get('book_allowed_types', array('book')))) {
// Note - we cannot use book_link_load() because it will call node_load()
$info['book'] = db_fetch_array(db_query('SELECT * FROM {book} b INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE b.nid = %d', $node->nid));
if ($info['book']) {
$info['book']['href'] = $info['book']['link_path'];
$info['book']['title'] = $info['book']['link_title'];
$info['book']['options'] = unserialize($info['book']['options']);
return $info;
}
}
break;
case 'view':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment