- Patch #1013864 by agentrickard, JimmyAx: book navigation block fails with Node Access modules.

merge-requests/26/head
Dries Buytaert 2011-05-21 20:10:40 -04:00
parent a73fabfacd
commit a060d31f0a
1 changed files with 4 additions and 4 deletions

View File

@ -279,10 +279,10 @@ function book_block_view($delta = '') {
}
elseif ($current_bid) {
// Only display this block when the user is browsing a book.
$select = db_select('node');
$select->addField('node', 'title');
$select->condition('nid', $node->book['bid']);
$select->addTag('node_access');
$select = db_select('node', 'n')
->fields('n', array('title'))
->condition('nid', $node->book['bid'])
->addTag('node_access');
$title = $select->execute()->fetchField();
// Only show the block if the user has view access for the top-level node.
if ($title) {