Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.622 diff -u -r1.622 comment.module --- modules/comment/comment.module 6 Apr 2008 18:50:11 -0000 1.622 +++ modules/comment/comment.module 9 Apr 2008 06:01:28 -0000 @@ -284,10 +284,10 @@ * * Generates a block with the most recent comments. */ -function comment_block($op = 'list', $delta = 0, $edit = array()) { +function comment_block($op = 'list', $delta = '', $edit = array()) { switch ($op) { case 'list': - $blocks[0]['info'] = t('Recent comments'); + $blocks['recent']['info'] = t('Recent comments'); return $blocks; case 'configure': Index: modules/system/block.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/modules/system/block.tpl.php,v retrieving revision 1.4 diff -u -r1.4 block.tpl.php --- modules/system/block.tpl.php 1 Sep 2007 05:42:48 -0000 1.4 +++ modules/system/block.tpl.php 9 Apr 2008 06:01:33 -0000 @@ -10,7 +10,7 @@ * - $block->subject: Block title. * - $block->content: Block content. * - $block->module: Module that generated the block. - * - $block->delta: This is a numeric id connected to each module. + * - $block->delta: An ID for the block, unique within each module. * - $block->region: The block region embedding the current block. * * Helper variables: Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.595 diff -u -r1.595 system.module --- modules/system/system.module 8 Apr 2008 22:50:55 -0000 1.595 +++ modules/system/system.module 9 Apr 2008 06:01:37 -0000 @@ -728,10 +728,10 @@ * * Generate a block with a promotional link to Drupal.org. */ -function system_block($op = 'list', $delta = 0, $edit = NULL) { +function system_block($op = 'list', $delta = '', $edit = NULL) { switch ($op) { case 'list': - $blocks[0] = array( + $blocks['powered-by'] = array( 'info' => t('Powered by Drupal'), 'weight' => '10', // Not worth caching. Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.245 diff -u -r1.245 system.install --- modules/system/system.install 8 Apr 2008 22:50:55 -0000 1.245 +++ modules/system/system.install 9 Apr 2008 06:01:36 -0000 @@ -374,9 +374,9 @@ db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'theme_default', 's:7:"garland";'); db_query("UPDATE {system} SET status = %d WHERE type = '%s' AND name = '%s'", 1, 'theme', 'garland'); - db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', '0', 'garland', 1, 0, 'left', '', -1); - db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', '1', 'garland', 1, 0, 'left', '', -1); - db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', '0', 'garland', 1, 10, 'footer', '', -1); + db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', 'login', 'garland', 1, 0, 'left', '', -1); + db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', 'navigation', 'garland', 1, 0, 'left', '', -1); + db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', 'powered-by', 'garland', 1, 10, 'footer', '', -1); db_query("INSERT INTO {node_access} (nid, gid, realm, grant_view, grant_update, grant_delete) VALUES (%d, %d, '%s', %d, %d, %d)", 0, 0, 'all', 1, 0, 0); @@ -2755,6 +2755,95 @@ return $ret; } +/** + * Remove hardcoded numeric deltas from all blocks in core. + */ +function system_update_7004(&$sandbox) { + $ret = array(); + // Get an array of the renamed block deltas, organized by module. + $renamed_deltas = array( + 'blog' => array('0' => 'recent'), + 'book' => array('0' => 'navigation'), + 'comment' => array('0' => 'recent'), + 'forum' => array( + '0' => 'active', + '1' => 'new', + ), + 'locale' => array('0' => 'language-switcher'), + 'node' => array('0' => 'syndicate'), + 'poll' => array('0' => 'recent'), + 'profile' => array('0' => 'author-information'), + 'search' => array('0' => 'form'), + 'statistics' => array('0' => 'popular'), + 'system' => array('0' => 'powered-by'), + 'user' => array( + '0' => 'login', + '1' => 'navigation', + '2' => 'new', + '3' => 'online', + ), + ); + // Loop through each block and make changes to the core block tables. + // Only run this the first time through the batch update. + if (!isset($sandbox['progress'])) { + $block_tables = array('blocks', 'blocks_roles'); + foreach ($block_tables as $table) { + foreach ($renamed_deltas as $module => $deltas) { + foreach ($deltas as $old_delta => $new_delta) { + // Only do the update if the old block actually exists. + if (db_result(db_query("SELECT COUNT(*) FROM {". $table ."} WHERE module = '%s' AND delta = '%s'", $module, $old_delta))) { + $ret[] = update_sql("UPDATE {". $table ."} SET delta = '". $new_delta ."' WHERE module = '". $module ."' AND delta = '". $old_delta ."'"); + } + } + } + } + // Rename forum module's block variables. + $forum_block_num_0 = variable_get('forum_block_num_0', NULL); + if (isset($forum_block_num_0)) { + variable_set('forum_block_num_active', $forum_block_num_0); + variable_del('forum_block_num_0'); + } + $forum_block_num_1 = variable_get('forum_block_num_1', NULL); + if (isset($forum_block_num_1)) { + variable_set('forum_block_num_new', $forum_block_num_1); + variable_del('forum_block_num_1'); + } + // Initialize batch update information. + $sandbox['progress'] = 0; + $sandbox['last_user_processed'] = -1; + $sandbox['max'] = db_result(db_query("SELECT COUNT(*) FROM {users} WHERE data IS NOT NULL")); + } + // Now do the batch update of the user-specific block visibility settings. + $limit = 100; + $result = db_query_range("SELECT uid, data FROM {users} WHERE uid > %d AND data IS NOT NULL", $sandbox['last_user_processed'], 0, $limit); + while ($row = db_fetch_object($result)) { + $data = unserialize($row->data); + $user_needs_update = FALSE; + foreach ($renamed_deltas as $module => $deltas) { + foreach ($deltas as $old_delta => $new_delta) { + if (isset($data['block'][$module][$old_delta])) { + // Transfer the old block visibility settings to the newly-renamed + // block, and mark this user for a database update. + $data['block'][$module][$new_delta] = $data['block'][$module][$old_delta]; + unset($data['block'][$module][$old_delta]); + $user_needs_update = TRUE; + } + } + } + // Update the current user. + if ($user_needs_update) { + db_query("UPDATE {users} SET data = '%s' WHERE uid = %d", serialize($data), $row->uid); + } + // Update our progress information for the batch update. + $sandbox['progress']++; + $sandbox['last_user_processed'] = $row->uid; + } + // Indicate our current progress to the batch update system. + if ($sandbox['progress'] < $sandbox['max']) { + $ret['#finished'] = $sandbox['progress'] / $sandbox['max']; + } + return $ret; +} /** * @} End of "defgroup updates-6.x-to-7.x" Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.214 diff -u -r1.214 locale.module --- modules/locale/locale.module 20 Feb 2008 13:46:39 -0000 1.214 +++ modules/locale/locale.module 9 Apr 2008 06:01:31 -0000 @@ -556,11 +556,11 @@ * Implementation of hook_block(). * Displays a language switcher. Translation links may be provided by other modules. */ -function locale_block($op = 'list', $delta = 0) { +function locale_block($op = 'list', $delta = '') { if ($op == 'list') { - $block[0]['info'] = t('Language switcher'); + $block['language-switcher']['info'] = t('Language switcher'); // Not worth caching. - $block[0]['cache'] = BLOCK_NO_CACHE; + $block['language-switcher']['cache'] = BLOCK_NO_CACHE; return $block; } Index: modules/profile/profile.module =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v retrieving revision 1.236 diff -u -r1.236 profile.module --- modules/profile/profile.module 3 Feb 2008 19:36:46 -0000 1.236 +++ modules/profile/profile.module 9 Apr 2008 06:01:33 -0000 @@ -131,14 +131,14 @@ /** * Implementation of hook_block(). */ -function profile_block($op = 'list', $delta = 0, $edit = array()) { +function profile_block($op = 'list', $delta = '', $edit = array()) { if ($op == 'list') { - $blocks[0]['info'] = t('Author information'); - $blocks[0]['cache'] = BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE; + $blocks['author-information']['info'] = t('Author information'); + $blocks['author-information']['cache'] = BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE; return $blocks; } - else if ($op == 'configure' && $delta == 0) { + else if ($op == 'configure') { // Compile a list of fields to show $fields = array(); $result = db_query('SELECT name, title, weight, visibility FROM {profile_fields} WHERE visibility IN (%d, %d) ORDER BY weight', PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS); @@ -146,7 +146,8 @@ $fields[$record->name] = check_plain($record->title); } $fields['user_profile'] = t('Link to full user profile'); - $form['profile_block_author_fields'] = array('#type' => 'checkboxes', + $form['profile_block_author_fields'] = array( + '#type' => 'checkboxes', '#title' => t('Profile fields to display'), '#default_value' => variable_get('profile_block_author_fields', NULL), '#options' => $fields, @@ -154,7 +155,7 @@ ); return $form; } - else if ($op == 'save' && $delta == 0) { + else if ($op == 'save') { variable_set('profile_block_author_fields', $edit['profile_block_author_fields']); } else if ($op == 'view') { Index: themes/garland/style-rtl.css =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/style-rtl.css,v retrieving revision 1.8 diff -u -r1.8 style-rtl.css --- themes/garland/style-rtl.css 13 Mar 2008 20:02:18 -0000 1.8 +++ themes/garland/style-rtl.css 9 Apr 2008 06:01:38 -0000 @@ -220,17 +220,17 @@ /** * Syndication Block */ -#block-node-0 h2 { +#block-node-syndicate h2 { float: right; padding-right: 0; padding-left: 20px; } -#block-node-0 img { +#block-node-syndicate img { float: left; } -#block-node-0 .content { +#block-node-syndicate .content { clear: left; } Index: themes/garland/style.css =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/style.css,v retrieving revision 1.42 diff -u -r1.42 style.css --- themes/garland/style.css 1 Apr 2008 19:38:37 -0000 1.42 +++ themes/garland/style.css 9 Apr 2008 06:01:40 -0000 @@ -865,17 +865,17 @@ /** * Syndication icons and block */ -#block-node-0 h2 { +#block-node-syndicate h2 { float: left; /* LTR */ padding-right: 20px; /* LTR */ } -#block-node-0 img, .feed-icon { +#block-node-syndicate img, .feed-icon { float: right; /* LTR */ padding-top: 4px; } -#block-node-0 .content { +#block-node-syndicate .content { clear: right; /* LTR */ } Index: modules/statistics/statistics.module =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v retrieving revision 1.273 diff -u -r1.273 statistics.module --- modules/statistics/statistics.module 20 Feb 2008 13:46:40 -0000 1.273 +++ modules/statistics/statistics.module 9 Apr 2008 06:01:33 -0000 @@ -242,13 +242,13 @@ /** * Implementation of hook_block(). */ -function statistics_block($op = 'list', $delta = 0, $edit = array()) { +function statistics_block($op = 'list', $delta = '', $edit = array()) { switch ($op) { case 'list': if (variable_get('statistics_count_content_views', 0)) { - $blocks[0]['info'] = t('Popular content'); + $blocks['popular']['info'] = t('Popular content'); // Too dynamic to cache. - $blocks[0]['cache'] = BLOCK_NO_CACHE; + $blocks['popular']['cache'] = BLOCK_NO_CACHE; return $blocks; } break; Index: modules/forum/forum.install =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.install,v retrieving revision 1.17 diff -u -r1.17 forum.install --- modules/forum/forum.install 15 Mar 2008 12:31:28 -0000 1.17 +++ modules/forum/forum.install 9 Apr 2008 06:01:28 -0000 @@ -57,8 +57,8 @@ variable_del('forum_hot_topic'); variable_del('forum_per_page'); variable_del('forum_order'); - variable_del('forum_block_num_0'); - variable_del('forum_block_num_1'); + variable_del('forum_block_num_active'); + variable_del('forum_block_num_new'); } /** Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.452 diff -u -r1.452 forum.module --- modules/forum/forum.module 20 Feb 2008 13:46:39 -0000 1.452 +++ modules/forum/forum.module 9 Apr 2008 06:01:29 -0000 @@ -401,11 +401,11 @@ * Generates a block containing the currently active forum topics and the * most recently added forum topics. */ -function forum_block($op = 'list', $delta = 0, $edit = array()) { +function forum_block($op = 'list', $delta = '', $edit = array()) { switch ($op) { case 'list': - $blocks[0]['info'] = t('Active forum topics'); - $blocks[1]['info'] = t('New forum topics'); + $blocks['active']['info'] = t('Active forum topics'); + $blocks['new']['info'] = t('New forum topics'); return $blocks; case 'configure': @@ -419,17 +419,17 @@ case 'view': if (user_access('access content')) { switch ($delta) { - case 0: + case 'active': $title = t('Active forum topics'); $sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {term_node} tn ON tn.vid = n.vid INNER JOIN {term_data} td ON td.tid = tn.tid INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND td.vid = %d ORDER BY l.last_comment_timestamp DESC"); - $result = db_query_range($sql, variable_get('forum_nav_vocabulary', ''), 0, variable_get('forum_block_num_0', '5')); + $result = db_query_range($sql, variable_get('forum_nav_vocabulary', ''), 0, variable_get('forum_block_num_active', '5')); $content = node_title_list($result); break; - case 1: + case 'new': $title = t('New forum topics'); $sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count FROM {node} n INNER JOIN {term_node} tn ON tn.vid = n.vid INNER JOIN {term_data} td ON td.tid = tn.tid INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND td.vid = %d ORDER BY n.nid DESC"); - $result = db_query_range($sql, variable_get('forum_nav_vocabulary', ''), 0, variable_get('forum_block_num_1', '5')); + $result = db_query_range($sql, variable_get('forum_nav_vocabulary', ''), 0, variable_get('forum_block_num_new', '5')); $content = node_title_list($result); break; } Index: modules/poll/poll.module =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v retrieving revision 1.264 diff -u -r1.264 poll.module --- modules/poll/poll.module 20 Feb 2008 13:46:40 -0000 1.264 +++ modules/poll/poll.module 9 Apr 2008 06:01:32 -0000 @@ -134,10 +134,10 @@ * * Generates a block containing the latest poll. */ -function poll_block($op = 'list', $delta = 0) { +function poll_block($op = 'list', $delta = '') { if (user_access('access content')) { if ($op == 'list') { - $blocks[0]['info'] = t('Most recent poll'); + $blocks['recent']['info'] = t('Most recent poll'); return $blocks; } else if ($op == 'view') { Index: modules/blog/blog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v retrieving revision 1.299 diff -u -r1.299 blog.module --- modules/blog/blog.module 20 Feb 2008 13:46:38 -0000 1.299 +++ modules/blog/blog.module 9 Apr 2008 06:01:26 -0000 @@ -172,10 +172,10 @@ * * Displays the most recent 10 blog titles. */ -function blog_block($op = 'list', $delta = 0) { +function blog_block($op = 'list', $delta = '') { global $user; if ($op == 'list') { - $block[0]['info'] = t('Recent blog posts'); + $block['recent']['info'] = t('Recent blog posts'); return $block; } else if ($op == 'view') { Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.375 diff -u -r1.375 aggregator.module --- modules/aggregator/aggregator.module 20 Feb 2008 13:46:37 -0000 1.375 +++ modules/aggregator/aggregator.module 9 Apr 2008 06:01:26 -0000 @@ -300,7 +300,7 @@ * * Generates blocks for the latest news items in each category and feed. */ -function aggregator_block($op = 'list', $delta = 0, $edit = array()) { +function aggregator_block($op = 'list', $delta = '', $edit = array()) { if (user_access('access news feeds')) { if ($op == 'list') { $result = db_query('SELECT cid, title FROM {aggregator_category} ORDER BY title'); Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.252 diff -u -r1.252 search.module --- modules/search/search.module 2 Apr 2008 20:13:37 -0000 1.252 +++ modules/search/search.module 9 Apr 2008 06:01:33 -0000 @@ -151,11 +151,11 @@ /** * Implementation of hook_block(). */ -function search_block($op = 'list', $delta = 0) { +function search_block($op = 'list', $delta = '') { if ($op == 'list') { - $blocks[0]['info'] = t('Search form'); + $blocks['form']['info'] = t('Search form'); // Not worth caching. - $blocks[0]['cache'] = BLOCK_NO_CACHE; + $blocks['form']['cache'] = BLOCK_NO_CACHE; return $blocks; } else if ($op == 'view' && user_access('search content')) { Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.899 diff -u -r1.899 user.module --- modules/user/user.module 8 Apr 2008 22:50:55 -0000 1.899 +++ modules/user/user.module 9 Apr 2008 06:01:38 -0000 @@ -635,27 +635,27 @@ /** * Implementation of hook_block(). */ -function user_block($op = 'list', $delta = 0, $edit = array()) { +function user_block($op = 'list', $delta = '', $edit = array()) { global $user; if ($op == 'list') { - $blocks[0]['info'] = t('User login'); + $blocks['login']['info'] = t('User login'); // Not worth caching. - $blocks[0]['cache'] = BLOCK_NO_CACHE; + $blocks['login']['cache'] = BLOCK_NO_CACHE; - $blocks[1]['info'] = t('Navigation'); + $blocks['navigation']['info'] = t('Navigation'); // Menu blocks can't be cached because each menu item can have // a custom access callback. menu.inc manages its own caching. - $blocks[1]['cache'] = BLOCK_NO_CACHE; + $blocks['navigation']['cache'] = BLOCK_NO_CACHE; - $blocks[2]['info'] = t('Who\'s new'); + $blocks['new']['info'] = t('Who\'s new'); // Too dynamic to cache. - $blocks[3]['info'] = t('Who\'s online'); - $blocks[3]['cache'] = BLOCK_NO_CACHE; + $blocks['online']['info'] = t('Who\'s online'); + $blocks['online']['cache'] = BLOCK_NO_CACHE; return $blocks; } - else if ($op == 'configure' && $delta == 2) { + else if ($op == 'configure' && $delta == 'new') { $form['user_block_whois_new_count'] = array( '#type' => 'select', '#title' => t('Number of users to display'), @@ -664,17 +664,17 @@ ); return $form; } - else if ($op == 'configure' && $delta == 3) { + else if ($op == 'configure' && $delta == 'online') { $period = drupal_map_assoc(array(30, 60, 120, 180, 300, 600, 900, 1800, 2700, 3600, 5400, 7200, 10800, 21600, 43200, 86400), 'format_interval'); $form['user_block_seconds_online'] = array('#type' => 'select', '#title' => t('User activity'), '#default_value' => variable_get('user_block_seconds_online', 900), '#options' => $period, '#description' => t('A user is considered online for this long after they have last viewed a page.')); $form['user_block_max_list_count'] = array('#type' => 'select', '#title' => t('User list length'), '#default_value' => variable_get('user_block_max_list_count', 10), '#options' => drupal_map_assoc(array(0, 5, 10, 15, 20, 25, 30, 40, 50, 75, 100)), '#description' => t('Maximum number of currently online users to display.')); return $form; } - else if ($op == 'save' && $delta == 2) { + else if ($op == 'save' && $delta == 'new') { variable_set('user_block_whois_new_count', $edit['user_block_whois_new_count']); } - else if ($op == 'save' && $delta == 3) { + else if ($op == 'save' && $delta == 'online') { variable_set('user_block_seconds_online', $edit['user_block_seconds_online']); variable_set('user_block_max_list_count', $edit['user_block_max_list_count']); } @@ -682,7 +682,7 @@ $block = array(); switch ($delta) { - case 0: + case 'login': // For usability's sake, avoid showing two login forms on one page. if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) { @@ -691,14 +691,14 @@ } return $block; - case 1: + case 'navigation': if ($menu = menu_tree()) { $block['subject'] = $user->uid ? check_plain($user->name) : t('Navigation'); $block['content'] = $menu; } return $block; - case 2: + case 'new': if (user_access('access content')) { // Retrieve a list of new users who have subsequently accessed the site successfully. $result = db_query_range('SELECT uid, name FROM {users} WHERE status != 0 AND access != 0 ORDER BY created DESC', 0, variable_get('user_block_whois_new_count', 5)); @@ -712,7 +712,7 @@ } return $block; - case 3: + case 'online': if (user_access('access content')) { // Count users active within the defined period. $interval = time() - variable_get('user_block_seconds_online', 900); Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.954 diff -u -r1.954 node.module --- modules/node/node.module 6 Apr 2008 18:50:12 -0000 1.954 +++ modules/node/node.module 9 Apr 2008 06:01:31 -0000 @@ -1607,11 +1607,11 @@ /** * Implementation of hook_block(). */ -function node_block($op = 'list', $delta = 0) { +function node_block($op = 'list', $delta = '') { if ($op == 'list') { - $blocks[0]['info'] = t('Syndicate'); + $blocks['syndicate']['info'] = t('Syndicate'); // Not worth caching. - $blocks[0]['cache'] = BLOCK_NO_CACHE; + $blocks['syndicate']['cache'] = BLOCK_NO_CACHE; return $blocks; } else if ($op == 'view') { Index: modules/menu/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v retrieving revision 1.159 diff -u -r1.159 menu.module --- modules/menu/menu.module 20 Feb 2008 13:46:40 -0000 1.159 +++ modules/menu/menu.module 9 Apr 2008 06:01:31 -0000 @@ -260,7 +260,7 @@ /** * Implementation of hook_block(). */ -function menu_block($op = 'list', $delta = 0) { +function menu_block($op = 'list', $delta = '') { $menus = menu_get_menus(); // The Navigation menu is handled by the user module. unset($menus['navigation']); Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.458 diff -u -r1.458 book.module --- modules/book/book.module 14 Mar 2008 08:51:37 -0000 1.458 +++ modules/book/book.module 9 Apr 2008 06:01:27 -0000 @@ -178,12 +178,12 @@ * Displays the book table of contents in a block when the current page is a * single-node view of a book node. */ -function book_block($op = 'list', $delta = 0, $edit = array()) { +function book_block($op = 'list', $delta = '', $edit = array()) { $block = array(); switch ($op) { case 'list': - $block[0]['info'] = t('Book navigation'); - $block[0]['cache'] = BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE; + $block['navigation']['info'] = t('Book navigation'); + $block['navigation']['cache'] = BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE; return $block; case 'view': $current_bid = 0;