Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.1088 diff -u -p -r1.1088 common.inc --- includes/common.inc 13 Jan 2010 13:03:26 -0000 1.1088 +++ includes/common.inc 14 Jan 2010 00:39:02 -0000 @@ -6181,7 +6181,7 @@ function drupal_flush_all_caches() { drupal_theme_rebuild(); menu_rebuild(); - node_types_rebuild(); + module_invoke('node', 'types_rebuild'); // Don't clear cache_form - in-progress form submissions may break. // Ordered so clearing the page cache will always be the last action. $core = array('cache', 'cache_filter', 'cache_bootstrap', 'cache_page'); Index: includes/module.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/module.inc,v retrieving revision 1.179 diff -u -p -r1.179 module.inc --- includes/module.inc 13 Jan 2010 05:08:29 -0000 1.179 +++ includes/module.inc 14 Jan 2010 00:39:02 -0000 @@ -438,8 +438,8 @@ function module_disable($module_list, $d foreach ($module_list as $module) { if (module_exists($module)) { // Check if node_access table needs rebuilding. - if (!node_access_needs_rebuild() && module_hook($module, 'node_grants')) { - node_access_needs_rebuild(TRUE); + if (!module_invoke('node', 'access_needs_rebuild') && module_hook($module, 'node_grants')) { + module_invoke('node', 'access_needs_rebuild', TRUE); } module_load_install($module); @@ -469,8 +469,8 @@ function module_disable($module_list, $d // If there remains no more node_access module, rebuilding will be // straightforward, we can do it right now. - if (node_access_needs_rebuild() && count(module_implements('node_grants')) == 0) { - node_access_rebuild(); + if (module_invoke('node', 'access_needs_rebuild') && count(module_implements('node_grants')) == 0) { + module_invoke('node', 'access_rebuild'); } } Index: modules/block/block.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v retrieving revision 1.71 diff -u -p -r1.71 block.admin.inc --- modules/block/block.admin.inc 10 Jan 2010 16:49:37 -0000 1.71 +++ modules/block/block.admin.inc 14 Jan 2010 00:39:02 -0000 @@ -265,6 +265,7 @@ function block_admin_configure($form, &$ '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'visibility', + '#weight' => 0, ); $access = user_access('use PHP for settings'); @@ -307,26 +308,6 @@ function block_admin_configure($form, &$ ); } - // Per-content type visibility. - $default_type_options = db_query("SELECT type FROM {block_node_type} WHERE module = :module AND delta = :delta", array( - ':module' => $block->module, - ':delta' => $block->delta, - ))->fetchCol(); - $form['visibility']['node_type'] = array( - '#type' => 'fieldset', - '#title' => t('Content types'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#group' => 'visibility', - ); - $form['visibility']['node_type']['types'] = array( - '#type' => 'checkboxes', - '#title' => t('Show block for specific content types'), - '#default_value' => $default_type_options, - '#options' => node_type_get_names(), - '#description' => t('Show this block only on pages that display content of the given type(s). If you select no types, there will be no type-specific limitation.'), - ); - // Per-role visibility. $default_role_options = db_query("SELECT rid FROM {block_role} WHERE module = :module AND delta = :delta", array( ':module' => $block->module, @@ -339,6 +320,7 @@ function block_admin_configure($form, &$ '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'visibility', + '#weight' => 10, ); $form['visibility']['role']['roles'] = array( '#type' => 'checkboxes', @@ -355,6 +337,7 @@ function block_admin_configure($form, &$ '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'visibility', + '#weight' => 20, ); $form['visibility']['user']['custom'] = array( '#type' => 'radios', @@ -418,20 +401,6 @@ function block_admin_configure_submit($f } $query->execute(); - db_delete('block_node_type') - ->condition('module', $form_state['values']['module']) - ->condition('delta', $form_state['values']['delta']) - ->execute(); - $query = db_insert('block_node_type')->fields(array('type', 'module', 'delta')); - foreach (array_filter($form_state['values']['types']) as $type) { - $query->values(array( - 'type' => $type, - 'module' => $form_state['values']['module'], - 'delta' => $form_state['values']['delta'], - )); - } - $query->execute(); - // Store regions per theme for this block foreach ($form_state['values']['regions'] as $theme => $region) { db_merge('block') @@ -507,16 +476,6 @@ function block_add_block_form_submit($fo } $query->execute(); - $query = db_insert('block_node_type')->fields(array('type', 'module', 'delta')); - foreach (array_filter($form_state['values']['types']) as $type) { - $query->values(array( - 'type' => $type, - 'module' => $form_state['values']['module'], - 'delta' => $delta, - )); - } - $query->execute(); - // Store regions per theme for this block foreach ($form_state['values']['regions'] as $theme => $region) { db_merge('block') Index: modules/blog/blog.info =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.info,v retrieving revision 1.11 diff -u -p -r1.11 blog.info --- modules/blog/blog.info 8 Jun 2009 09:23:51 -0000 1.11 +++ modules/blog/blog.info 14 Jan 2010 00:39:02 -0000 @@ -5,6 +5,7 @@ description = Enables multi-user blogs. package = Core version = VERSION core = 7.x +dependencies[] = node files[] = blog.module files[] = blog.pages.inc files[] = blog.test Index: modules/book/book.info =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.info,v retrieving revision 1.13 diff -u -p -r1.13 book.info --- modules/book/book.info 17 Nov 2009 21:24:18 -0000 1.13 +++ modules/book/book.info 14 Jan 2010 00:39:02 -0000 @@ -4,6 +4,7 @@ description = Allows users to create and package = Core version = VERSION core = 7.x +dependencies[] = node files[] = book.module files[] = book.admin.inc files[] = book.pages.inc Index: modules/comment/comment.info =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.info,v retrieving revision 1.12 diff -u -p -r1.12 comment.info --- modules/comment/comment.info 17 Nov 2009 21:24:18 -0000 1.12 +++ modules/comment/comment.info 14 Jan 2010 00:39:02 -0000 @@ -4,6 +4,7 @@ description = Allows users to comment on package = Core version = VERSION core = 7.x +dependencies[] = node files[] = comment.module files[] = comment.admin.inc files[] = comment.pages.inc Index: modules/locale/locale.install =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.install,v retrieving revision 1.55 diff -u -p -r1.55 locale.install --- modules/locale/locale.install 9 Jan 2010 22:07:56 -0000 1.55 +++ modules/locale/locale.install 14 Jan 2010 00:39:02 -0000 @@ -121,8 +121,10 @@ function locale_uninstall() { variable_del("locale_language_providers_weight_$type"); } - foreach (node_type_get_types() as $type => $content_type) { - $setting = variable_del("language_content_type_$type"); + if ($types = module_invoke('node', 'type_get_types')) { + foreach ($types as $type => $content_type) { + $setting = variable_del("language_content_type_$type"); + } } // Switch back to English: with a $language->language value different from 'en' Index: modules/node/node.install =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.install,v retrieving revision 1.39 diff -u -p -r1.39 node.install --- modules/node/node.install 9 Jan 2010 22:07:57 -0000 1.39 +++ modules/node/node.install 14 Jan 2010 00:39:02 -0000 @@ -357,6 +357,22 @@ function node_schema() { } /** + * Implements hook_install(). + */ +function node_install() { + db_insert('node_access') + ->fields(array( + 'nid' => 0, + 'gid' => 0, + 'realm' => 'all', + 'grant_view' => 1, + 'grant_update' => 0, + 'grant_delete' => 0, + )) + ->execute(); +} + +/** * @defgroup updates-6.x-to-7.x System updates from 6.x to 7.x * @{ */ Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1212 diff -u -p -r1.1212 node.module --- modules/node/node.module 13 Jan 2010 12:58:47 -0000 1.1212 +++ modules/node/node.module 14 Jan 2010 00:39:02 -0000 @@ -2176,6 +2176,64 @@ function theme_node_recent_content($vari } /** + * Implements hook_form_FORMID_alter(). + * + * Adds node-type specific visibility options to add block form. + */ +function node_form_block_add_block_form_alter(&$form, &$form_state) { + node_form_block_admin_configure_alter($form, $form_state); +} + +/** + * Implements hook_form_FORMID_alter(). + * + * Adds node-type specific visibility options to block configuration form. + */ +function node_form_block_admin_configure_alter(&$form, &$form_state) { + $default_type_options = db_query("SELECT type FROM {block_node_type} WHERE module = :module AND delta = :delta", array( + ':module' => $form['module']['#value'], + ':delta' => $form['delta']['#value'], + ))->fetchCol(); + $form['visibility']['node_type'] = array( + '#type' => 'fieldset', + '#title' => t('Content types'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#group' => 'visibility', + '#weight' => 5, + ); + $form['visibility']['node_type']['types'] = array( + '#type' => 'checkboxes', + '#title' => t('Show block for specific content types'), + '#default_value' => $default_type_options, + '#options' => node_type_get_names(), + '#description' => t('Show this block only on pages that display content of the given type(s). If you select no types, there will be no type-specific limitation.'), + ); + $form['#submit'][] = 'node_block_admin_configure_submit'; +} + +/** + * Form submit handler for block configuration form. + */ +function node_block_admin_configure_submit($form, &$form_state) { + if (isset($form_state['values']['delta'])) { + db_delete('block_node_type') + ->condition('module', $form_state['values']['module']) + ->condition('delta', $form_state['values']['delta']) + ->execute(); + } + $query = db_insert('block_node_type')->fields(array('type', 'module', 'delta')); + foreach (array_filter($form_state['values']['types']) as $type) { + $query->values(array( + 'type' => $type, + 'module' => $form_state['values']['module'], + 'delta' => $form_state['values']['delta'], + )); + } + $query->execute(); +} + +/** * A generic function for generating RSS feeds from a set of nodes. * * @param $nids Index: modules/poll/poll.info =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.info,v retrieving revision 1.10 diff -u -p -r1.10 poll.info --- modules/poll/poll.info 19 Aug 2009 20:19:36 -0000 1.10 +++ modules/poll/poll.info 14 Jan 2010 00:39:02 -0000 @@ -4,6 +4,7 @@ description = Allows your site to captur package = Core version = VERSION core = 7.x +dependencies[] = node files[] = poll.module files[] = poll.pages.inc files[] = poll.install Index: modules/shortcut/shortcut.install =================================================================== RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.install,v retrieving revision 1.3 diff -u -p -r1.3 shortcut.install --- modules/shortcut/shortcut.install 20 Dec 2009 20:17:11 -0000 1.3 +++ modules/shortcut/shortcut.install 14 Jan 2010 00:39:02 -0000 @@ -19,18 +19,19 @@ function shortcut_enable() { // Create an initial default shortcut set. $shortcut_set = new StdClass(); $shortcut_set->title = $t('Default'); - $shortcut_set->links = array( - array( + $shortcut_set->links = array(); + if (module_exists('node')) { + $shortcut_set->links[] = array( 'link_path' => 'node/add', 'link_title' => $t('Add content'), 'weight' => -20, - ), - array( + ); + $shortcut_set->links[] = array( 'link_path' => 'admin/content', 'link_title' => $t('Find content'), 'weight' => -19, - ), - ); + ); + } shortcut_set_save($shortcut_set); } Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.250 diff -u -p -r1.250 system.admin.inc --- modules/system/system.admin.inc 13 Jan 2010 05:08:29 -0000 1.250 +++ modules/system/system.admin.inc 14 Jan 2010 00:39:02 -0000 @@ -1236,7 +1236,7 @@ function system_modules_submit($form, &$ // Clear all caches. registry_rebuild(); drupal_theme_rebuild(); - node_types_rebuild(); + module_invoke('node', 'types_rebuild'); menu_rebuild(); cache_clear_all('schema', 'cache'); entity_info_cache_clear(); @@ -1252,8 +1252,6 @@ function system_modules_submit($form, &$ // Synchronize to catch any actions that were added or removed. actions_synchronize(); - - return; } /** Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.442 diff -u -p -r1.442 system.install --- modules/system/system.install 13 Jan 2010 06:15:39 -0000 1.442 +++ modules/system/system.install 14 Jan 2010 00:39:50 -0000 @@ -419,17 +419,6 @@ function system_install() { ->condition('name', 'garland') ->execute(); - db_insert('node_access') - ->fields(array( - 'nid' => 0, - 'gid' => 0, - 'realm' => 'all', - 'grant_view' => 1, - 'grant_update' => 0, - 'grant_delete' => 0, - )) - ->execute(); - $cron_key = md5(mt_rand()); variable_set('cron_key', $cron_key); Index: modules/translation/translation.info =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.info,v retrieving revision 1.5 diff -u -p -r1.5 translation.info --- modules/translation/translation.info 8 Jun 2009 09:23:54 -0000 1.5 +++ modules/translation/translation.info 14 Jan 2010 00:39:12 -0000 @@ -1,6 +1,7 @@ ; $Id: translation.info,v 1.5 2009/06/08 09:23:54 dries Exp $ name = Content translation description = Allows content to be translated into different languages. +dependencies[] = node dependencies[] = locale package = Core version = VERSION