? .DS_Store ? make_node_optional_04.patch ? make_node_optional_05.patch ? make_node_optional_06.patch ? profiles/.DS_Store ? sites/.DS_Store ? sites/default/.DS_Store ? sites/default/files ? sites/default/settings.php Index: includes/module.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/module.inc,v retrieving revision 1.139 diff -u -p -r1.139 module.inc --- includes/module.inc 22 Feb 2009 17:55:29 -0000 1.139 +++ includes/module.inc 27 Mar 2009 21:02:07 -0000 @@ -266,17 +266,12 @@ function module_enable($module_list) { module_list(TRUE); // Force to regenerate the stored list of hook implementations. registry_rebuild(); + // Rebuild the menu. + menu_rebuild(); } foreach ($invoke_modules as $module) { module_invoke($module, 'enable'); - // Check if node_access table needs rebuilding. - // We check for the existence of node_access_needs_rebuild() since - // at install time, module_enable() could be called while node.module - // is not enabled yet. - if (drupal_function_exists('node_access_needs_rebuild') && !node_access_needs_rebuild() && module_hook($module, 'node_grants')) { - node_access_needs_rebuild(TRUE); - } } if (!empty($invoke_modules)) { @@ -296,11 +291,6 @@ function module_disable($module_list) { $invoke_modules = array(); 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); - } - module_load_install($module); module_invoke($module, 'disable'); db_update('system') @@ -320,12 +310,8 @@ function module_disable($module_list) { module_list(TRUE); // Force to regenerate the stored list of hook implementations. registry_rebuild(); - } - - // 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(); + // Rebuild the menu. + menu_rebuild(); } } Index: modules/blog/blog.info =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.info,v retrieving revision 1.10 diff -u -p -r1.10 blog.info --- modules/blog/blog.info 11 Oct 2008 02:32:36 -0000 1.10 +++ modules/blog/blog.info 27 Mar 2009 21:02:07 -0000 @@ -6,4 +6,4 @@ package = Core version = VERSION core = 7.x files[] = blog.module -files[] = blog.pages.inc +files[] = blog.pages.inc \ No newline at end of file Index: modules/blogapi/blogapi.test =================================================================== RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.test,v retrieving revision 1.9 diff -u -p -r1.9 blogapi.test --- modules/blogapi/blogapi.test 22 Feb 2009 17:55:29 -0000 1.9 +++ modules/blogapi/blogapi.test 27 Mar 2009 21:02:07 -0000 @@ -11,7 +11,7 @@ class BlogAPITestCase extends DrupalWebT } function setUp() { - parent::setUp('blog', 'blogapi', 'taxonomy'); + parent::setUp('node', 'blog', 'blogapi', 'taxonomy'); } /** Index: modules/book/book.info =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.info,v retrieving revision 1.11 diff -u -p -r1.11 book.info --- modules/book/book.info 13 Oct 2008 19:59:41 -0000 1.11 +++ modules/book/book.info 27 Mar 2009 21:02:07 -0000 @@ -9,3 +9,4 @@ files[] = book.module files[] = book.admin.inc files[] = book.pages.inc files[] = book.install +dependencies[] = node \ No newline at end of file Index: modules/book/book.test =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.test,v retrieving revision 1.7 diff -u -p -r1.7 book.test --- modules/book/book.test 23 Dec 2008 14:32:08 -0000 1.7 +++ modules/book/book.test 27 Mar 2009 21:02:08 -0000 @@ -13,7 +13,7 @@ class BookTestCase extends DrupalWebTest } function setUp() { - parent::setUp('book'); + parent::setUp('node', 'book'); } /** @@ -183,7 +183,7 @@ class BookBlockTestCase extends DrupalWe } function setUp() { - parent::setUp('book'); + parent::setUp('node', 'book'); // Create and login user $admin_user = $this->drupalCreateUser(array('administer blocks')); Index: modules/forum/forum.test =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.test,v retrieving revision 1.15 diff -u -p -r1.15 forum.test --- modules/forum/forum.test 13 Feb 2009 05:42:24 -0000 1.15 +++ modules/forum/forum.test 27 Mar 2009 21:02:08 -0000 @@ -23,7 +23,7 @@ class ForumTestCase extends DrupalWebTes * Enable modules and create users with specific permissions. */ function setUp() { - parent::setUp('taxonomy', 'comment', 'forum'); + parent::setUp('node', 'taxonomy', 'comment', 'forum'); // Create users. $this->big_user = $this->drupalCreateUser(array('administer blocks', 'administer forums', 'administer menu', 'administer taxonomy', 'create forum content')); // 'access administration pages')); $this->own_user = $this->drupalCreateUser(array('create forum content', 'edit own forum content', 'delete own forum content')); Index: modules/node/node.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.admin.inc,v retrieving revision 1.43 diff -u -p -r1.43 node.admin.inc --- modules/node/node.admin.inc 20 Mar 2009 08:14:34 -0000 1.43 +++ modules/node/node.admin.inc 27 Mar 2009 21:02:08 -0000 @@ -7,6 +7,50 @@ */ /** + * Implementation of hook_form_alter(). + */ +function node_form_system_themes_form_alter(&$form, $form_state) { + $form['admin_theme']['node_admin_theme'] = array( + '#type' => 'checkbox', + '#title' => t('Use administration theme for content editing'), + '#description' => t('Use the administration theme when editing existing posts or creating new ones.'), + '#default_value' => variable_get('node_admin_theme', '0'), + ); +} + +/** + * Implementation of hook_modules_enabled(). + */ +function node_modules_enabled($modules) { + node_types_rebuild(); + foreach ($modules as $module) { + if (!node_access_needs_rebuild() && module_hook($module, 'node_grants')) { + node_access_needs_rebuild(TRUE); + } + } +} + +/** + * Implementation of hook_modules_disabled(). + */ +function node_modules_disabled($modules) { + if (!node_access_needs_rebuild()) { + $node_grants = array(); + foreach ($modules as $module) { + // Check if node_access table needs rebuilding. + if (module_hook($module, 'node_grants')) { + $node_grants = $module; + } + } + + // If there remains no more node_access module, rebuild permissions. + if (!empty($node_grants) && count(array_diff(module_implements('node_grants'), $node_grants)) == 0) { + node_access_rebuild(); + } + } +} + +/** * Menu callback; presents general node configuration options. */ function node_configure() { Index: modules/node/node.info =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.info,v retrieving revision 1.10 diff -u -p -r1.10 node.info --- modules/node/node.info 12 Oct 2008 01:23:04 -0000 1.10 +++ modules/node/node.info 27 Mar 2009 21:02:08 -0000 @@ -8,5 +8,4 @@ files[] = node.module files[] = content_types.inc files[] = node.admin.inc files[] = node.pages.inc -files[] = node.install -required = TRUE +files[] = node.install \ No newline at end of file Index: modules/node/node.install =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.install,v retrieving revision 1.14 diff -u -p -r1.14 node.install --- modules/node/node.install 17 Mar 2009 12:41:54 -0000 1.14 +++ modules/node/node.install 27 Mar 2009 21:02:08 -0000 @@ -378,10 +378,57 @@ function node_schema() { 'primary key' => array('type'), ); + $schema['history'] = array( + 'description' => 'A record of which {users} have read which {node}s.', + 'fields' => array( + 'uid' => array( + 'description' => 'The {users}.uid that read the {node} nid.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'nid' => array( + 'description' => 'The {node}.nid that was read.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'timestamp' => array( + 'description' => 'The Unix timestamp at which the read occurred.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'primary key' => array('uid', 'nid'), + 'indexes' => array( + 'nid' => array('nid'), + ), + ); + return $schema; } /** + * Implementation of hook_install(). + */ +function node_install() { + drupal_install_schema('node'); + + 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); + db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'node_options_forum', 'a:1:{i:0;s:6:"status";}'); +} + +/** + * Implementation of hook_uninstall(). + */ +function node_uninstall() { + drupal_uninstall_schema('node'); + + db_query("DELETE FROM {variable} WHERE name LIKE 'node_%'"); +} + +/** * Drupal 6.x to 7.x updates */ Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1033 diff -u -p -r1.1033 node.module --- modules/node/node.module 26 Mar 2009 13:31:25 -0000 1.1033 +++ modules/node/node.module 27 Mar 2009 21:02:10 -0000 @@ -542,8 +542,6 @@ function node_types_rebuild() { } _node_types_build(); - // This is required for proper menu items at node/add/type. - menu_rebuild(); } /** Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.131 diff -u -p -r1.131 system.admin.inc --- modules/system/system.admin.inc 17 Mar 2009 15:26:29 -0000 1.131 +++ modules/system/system.admin.inc 27 Mar 2009 21:02:10 -0000 @@ -215,12 +215,6 @@ function system_themes_form() { '#description' => t('Choose which theme the administration pages should display in. If you choose "Default theme" the administration pages will use the same theme as the rest of the site.'), '#default_value' => variable_get('admin_theme', 0), ); - $form['admin_theme']['node_admin_theme'] = array( - '#type' => 'checkbox', - '#title' => t('Use administration theme for content editing'), - '#description' => t('Use the administration theme when editing existing posts or creating new ones.'), - '#default_value' => variable_get('node_admin_theme', '0'), - ); $form['buttons']['submit'] = array( '#type' => 'submit', @@ -238,7 +232,6 @@ function system_themes_form() { * Process system_themes_form form submissions. */ function system_themes_form_submit($form, &$form_state) { - // Store list of previously enabled themes and disable all themes $old_theme_list = $new_theme_list = array(); foreach (list_themes() as $theme) { @@ -572,8 +565,8 @@ function _system_is_incompatible(&$incom function system_modules($form_state = array()) { // Clear all caches. registry_rebuild(); + menu_rebuild(); drupal_theme_rebuild(); - node_types_rebuild(); cache_clear_all('schema', 'cache'); // Get current list of modules. $files = module_rebuild_cache(); Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.312 diff -u -p -r1.312 system.install --- modules/system/system.install 17 Mar 2009 15:26:29 -0000 1.312 +++ modules/system/system.install 27 Mar 2009 21:02:12 -0000 @@ -330,7 +330,7 @@ function system_install() { } // Create tables. - $modules = array('system', 'filter', 'user', 'node'); + $modules = array('system', 'filter', 'user'); foreach ($modules as $module) { drupal_install_schema($module); } @@ -370,8 +370,6 @@ function system_install() { 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 {node_access} (nid, gid, realm, grant_view, grant_update, grant_delete) VALUES (%d, %d, '%s', %d, %d, %d)", 0, 0, 'all', 1, 0, 0); - // Add text formats. db_query("INSERT INTO {filter_format} (name, roles, cache) VALUES ('%s', '%s', %d)", 'Filtered HTML', ',1,2,', 1); db_query("INSERT INTO {filter_format} (name, roles, cache) VALUES ('%s', '%s', %d)", 'Full HTML', '', 1); @@ -398,8 +396,6 @@ function system_install() { db_query("INSERT INTO {variable} (name, value) VALUES ('%s','%s')", 'filter_html_1', 'i:1;'); - db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'node_options_forum', 'a:1:{i:0;s:6:"status";}'); - $cron_key = serialize(md5(mt_rand())); db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'cron_key', $cron_key); @@ -699,33 +695,6 @@ function system_schema() { ), ); - $schema['history'] = array( - 'description' => 'A record of which {users} have read which {node}s.', - 'fields' => array( - 'uid' => array( - 'description' => 'The {users}.uid that read the {node} nid.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - 'nid' => array( - 'description' => 'The {node}.nid that was read.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - 'timestamp' => array( - 'description' => 'The Unix timestamp at which the read occurred.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - ), - 'primary key' => array('uid', 'nid'), - 'indexes' => array( - 'nid' => array('nid'), - ), - ); $schema['menu_router'] = array( 'description' => 'Maps paths to various callbacks (access, page and title)', 'fields' => array( Index: modules/taxonomy/taxonomy.info =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.info,v retrieving revision 1.8 diff -u -p -r1.8 taxonomy.info --- modules/taxonomy/taxonomy.info 11 Oct 2008 02:33:06 -0000 1.8 +++ modules/taxonomy/taxonomy.info 27 Mar 2009 21:02:12 -0000 @@ -8,3 +8,4 @@ files[] = taxonomy.module files[] = taxonomy.admin.inc files[] = taxonomy.pages.inc files[] = taxonomy.install +dependencies[] = node \ No newline at end of file Index: modules/taxonomy/taxonomy.test =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v retrieving revision 1.26 diff -u -p -r1.26 taxonomy.test --- modules/taxonomy/taxonomy.test 8 Mar 2009 04:25:07 -0000 1.26 +++ modules/taxonomy/taxonomy.test 27 Mar 2009 21:02:12 -0000 @@ -52,7 +52,7 @@ class TaxonomyVocabularyFunctionalTest e } function setUp() { - parent::setUp(); + parent::setUp('node'); $this->admin_user = $this->drupalCreateUser(array('administer taxonomy')); $this->drupalLogin($this->admin_user); $this->vocabulary = $this->createVocabulary(); @@ -248,6 +248,10 @@ class TaxonomyTermUnitTest extends Taxon ); } + function setUp() { + parent::setUp('node'); + } + /** * Tests for taxonomy_term_count_nodes(). * @@ -324,7 +328,7 @@ class TaxonomyTermTestCase extends Taxon } function setUp() { - parent::setUp('taxonomy'); + parent::setUp('node', 'taxonomy'); $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access')); $this->drupalLogin($this->admin_user); $this->vocabulary = $this->createVocabulary(); Index: profiles/default/default.profile =================================================================== RCS file: /cvs/drupal/drupal/profiles/default/default.profile,v retrieving revision 1.39 diff -u -p -r1.39 default.profile --- profiles/default/default.profile 20 Mar 2009 19:18:11 -0000 1.39 +++ profiles/default/default.profile 27 Mar 2009 21:02:12 -0000 @@ -8,7 +8,7 @@ * An array of modules to enable. */ function default_profile_modules() { - return array('block', 'color', 'comment', 'help', 'menu', 'taxonomy', 'dblog'); + return array('node', 'block', 'color', 'comment', 'help', 'menu', 'taxonomy', 'dblog'); } /** Index: profiles/expert/expert.profile =================================================================== RCS file: /cvs/drupal/drupal/profiles/expert/expert.profile,v retrieving revision 1.5 diff -u -p -r1.5 expert.profile --- profiles/expert/expert.profile 20 Mar 2009 19:18:11 -0000 1.5 +++ profiles/expert/expert.profile 27 Mar 2009 21:02:12 -0000 @@ -8,7 +8,7 @@ * An array of modules to enable. */ function expert_profile_modules() { - return array('block', 'dblog'); + return array('node', 'block', 'dblog'); } /**