/[drupal]/contributions/modules/delete_all/delete_all.module
ViewVC logotype

Diff of /contributions/modules/delete_all/delete_all.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.6, Fri Jan 18 19:22:35 2008 UTC revision 1.1.2.7, Sat Jan 26 14:44:40 2008 UTC
# Line 72  function delete_all_content() { Line 72  function delete_all_content() {
72        '#title' => t('Method'),        '#title' => t('Method'),
73        '#options' => array('normal' => t('Normal'), 'quick' => t('Quick')),        '#options' => array('normal' => t('Normal'), 'quick' => t('Quick')),
74        '#default_value' => 'normal',        '#default_value' => 'normal',
75        '#description' => t('Normal node delete calls node_delete() on every node in the database.  If you have only a few hundred nodes, this can take a very long time.  Use the quick node delete method to get around this problem.  This method deletes directly from the database, skipping the extra php processing.  It does a pretty good job; the only downside is that it experimental and can miss related tables that are normally handled by module hook_delete\'s, although it does try to catch these, and in actuality may not miss anything.'),        '#description' => t('Normal node delete calls node_delete() on every node in the database.  If you have only a few hundred nodes, this can take a very long time.  Use the quick node delete method to get around this problem.  This method deletes directly from the database, skipping the extra php processing.  The downside is that it can miss related tables that are normally handled by module hook_delete\'s.'),
76      ),      ),
77    );    );
78    $form['confirm'] = array(    $form['confirm'] = array(
# Line 196  function _delete_all_quick($types) { Line 196  function _delete_all_quick($types) {
196        $tables = array('node_revisions' => $nid_vid, 'comments' => $nid);        $tables = array('node_revisions' => $nid_vid, 'comments' => $nid);
197        $tables[_content_tablename($type, CONTENT_DB_STORAGE_PER_CONTENT_TYPE)] = $nid_vid;        $tables[_content_tablename($type, CONTENT_DB_STORAGE_PER_CONTENT_TYPE)] = $nid_vid;
198        $content = content_types($type);        $content = content_types($type);
199        if (count($content->fields)) {        if (count($content['fields'])) {
200          foreach ($content->fields as $field) {          foreach ($content['fields'] as $field) {
201            $field_info = content_database_info($field);            $field_info = content_database_info($field);
202            $tables[$field_info['table']] = $nid_vid;            $tables[$field_info['table']] = $nid_vid;
203          }          }
# Line 229  function _delete_all_quick($types) { Line 229  function _delete_all_quick($types) {
229            break;            break;
230        }        }
231    
232          // @todo: update all node related nid references
233    
234        // delete from all of the content tables in one sql statement        // delete from all of the content tables in one sql statement
235        $sql = array('delete' => array(), 'from' => array(), 'where' => array());        $sql = array('delete' => array(), 'from' => array(), 'where' => array());
236        $index = 0;        $index = 0;

Legend:
Removed from v.1.1.2.6  
changed lines
  Added in v.1.1.2.7

  ViewVC Help
Powered by ViewVC 1.1.2