? modules/blog/.blog.install.swp ? modules/field/.field.attach.inc.swp ? modules/forum/.forum.install.swp ? modules/node/.node.module.swp ? modules/system/.system.queue.inc.swp ? sites/default/files ? sites/default/settings.php Index: modules/node/content_types.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/content_types.inc,v retrieving revision 1.116 diff -u -p -r1.116 content_types.inc --- modules/node/content_types.inc 8 Aug 2010 13:02:37 -0000 1.116 +++ modules/node/content_types.inc 27 Aug 2010 11:07:54 -0000 @@ -430,7 +430,7 @@ function node_type_delete_confirm($form, $num_nodes = db_query("SELECT COUNT(*) FROM {node} WHERE type = :type", array(':type' => $type->type))->fetchField(); if ($num_nodes) { - $caption .= '

' . format_plural($num_nodes, '%type is used by 1 piece of content on your site. If you remove this content type, you will not be able to edit the %type content and it may not display correctly.', '%type is used by @count pieces of content on your site. If you remove %type, you will not be able to edit the %type content and it may not display correctly.', array('%type' => $type->name)) . '

'; + $caption .= '

' . format_plural($num_nodes, '%type is used by 1 piece of content on your site. If you remove this content type, your content will be deleted.', '%type is used by @count pieces of content on your site. If you remove %type, you will not be able to edit the %type content your content will be deleted. If you have a large amount of content the deletion will be queued and performed over time.', array('%type' => $type->name)) . '

'; } $caption .= '

' . t('This action cannot be undone.') . '

'; Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1293 diff -u -p -r1.1293 node.module --- modules/node/node.module 23 Aug 2010 22:15:34 -0000 1.1293 +++ modules/node/node.module 27 Aug 2010 11:07:54 -0000 @@ -163,6 +163,13 @@ function node_cron() { db_delete('history') ->condition('timestamp', NODE_NEW_LIMIT, '<') ->execute(); + + // Delete any nodes queued for deletion. + $queue = DrupalQueue::get('node_delete'); + if ($item = $queue->claimItem()) { + node_delete_multiple($item->data); + $queue->deleteItem($item); + } } /** @@ -633,6 +640,9 @@ function node_type_delete($type) { field_attach_delete_bundle('node', $type); module_invoke_all('node_type_delete', $info); + $nids = db_query("SELECT FROM {node} WHERE type=:type", array(':type' => $node_type))->fetchCol(); + node_delete_multiple($nids); + // Clear the node type cache. drupal_static_reset('_node_types_build'); } @@ -1136,6 +1146,15 @@ function node_delete($nid) { */ function node_delete_multiple($nids) { if (!empty($nids)) { + if (count($nids) > 10) { + $queue = DrupalQueue::get('node_delete'); + $queue->createQueue(); + $jobs = array_chunk($nids, 10); + $nids = array_pop($jobs); + foreach ($jobs as $job) { + $queue->createItem($job); + } + } $nodes = node_load_multiple($nids, array()); foreach ($nodes as $nid => $node) { @@ -2291,6 +2310,16 @@ function node_modules_uninstalled($modul db_delete('block_node_type') ->condition('module', $modules, 'IN') ->execute(); + + // Remove nodes of types provided by uninstalled modules. + $node_types = array(); + foreach ($modules as $module) { + $node_types += array_keys(module_invoke($module, 'node_info')); + } + foreach ($node_types as $node_type) { + $nids = db_query("SELECT FROM {node} WHERE type=:type", array(':type' => $node_type))->fetchCol(); + node_delete_multiple($nids); + } } /**