? delete_by_node_type.patch ? hyphen_remove_default_and_warn.patch ? i18n-ascii.txt ? nohup.out ? pathauto_2.x-dev-bulk-update-forum-alias-fix.patch ? pathauto_node_type_delete.patch ? pathauto_path_redirect.patch Index: pathauto.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.module,v retrieving revision 1.44.4.36 diff -u -p -r1.44.4.36 pathauto.module --- pathauto.module 19 Oct 2007 00:55:15 -0000 1.44.4.36 +++ pathauto.module 21 Oct 2007 19:07:48 -0000 @@ -378,11 +378,25 @@ function pathauto_admin_delete() { foreach ($objects as $internal_name => $label) { $count = db_result(db_query("SELECT count(1) FROM {url_alias} WHERE src LIKE '%s%%'", $internal_name)); $form['delete'][$internal_name] = array('#type' => 'checkbox', - '#title' => t($label), + '#title' => t('@label aliases', array('@label' => $label)), '#default_value' => FALSE, '#description' => t('Delete aliases for all @label. Number of aliases which will be deleted: %count.', array('@label' => $label, '%count' => $count))); } + $form["delete_node_type"] = array('#type' => 'fieldset', + '#title' => t('Choose Node Type Aliases to Delete'), '#collapsible' => FALSE, + '#collapsed' => FALSE); + + $node_types = node_get_types(); + foreach($node_types as $node_type) { + $count = db_result(db_query("SELECT count(1) FROM {url_alias} INNER JOIN node ON url_alias.src = CONCAT('node/', node.nid) WHERE node.type = '%s'", $node_type->type)); + $form['delete_node_type'][$node_type->type] = array('#type' => 'checkbox', + '#title' => t('@label aliases', array('@label' => $node_type->name)), + '#default_value' => FALSE, + '#description' => t('Delete all @type aliases. Number of aliases which will be deleted: %count.', array('@type' => $node_type->name, '%count' => $count)) + ); + } + // Warn them and give a button that shows we mean business $form["warning"] = array('#value' => t('

Note: there is no confirmation. Be sure of your action before clicking the "Delete aliases now!" button. You may want to make a backup of the database and/or the url_alias table prior to using this feature.

')); $form['buttons']['submit'] = array( @@ -405,7 +419,6 @@ function pathauto_admin_delete_submit($f } $objects = _pathauto_objects_to_delete(); if (array_key_exists($key, $objects)) { - drupal_set_message($key); db_query("DELETE FROM {url_alias} WHERE src LIKE '%s%%'", $key); drupal_set_message(t('All of your %type path aliases have been deleted.', array('%type' => $objects[$key]))); }