Index: content_profile.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/content_profile/Attic/content_profile.install,v retrieving revision 1.1.2.7 diff -u -p -r1.1.2.7 content_profile.install --- content_profile.install 9 Jan 2009 15:55:07 -0000 1.1.2.7 +++ content_profile.install 30 Jul 2010 19:56:55 -0000 @@ -75,6 +75,7 @@ function content_profile_import() { function content_profile_uninstall() { foreach (node_get_types('names') as $typename => $visiblename) { if (variable_get('content_profile_use'. $typename, 0)) { + variable_del('content_profile_remove_'. $typename); variable_del('content_profile_use_'. $typename); variable_del('content_profile_'. $typename); } Index: content_profile.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/content_profile/Attic/content_profile.module,v retrieving revision 1.1.2.48 diff -u -p -r1.1.2.48 content_profile.module --- content_profile.module 7 Apr 2010 15:09:17 -0000 1.1.2.48 +++ content_profile.module 30 Jul 2010 19:56:56 -0000 @@ -270,6 +270,12 @@ function content_profile_form_alter(&$fo '#title' => t('Use this content type as a content profile for users'), '#default_value' => variable_get('content_profile_use_'. $form['#node_type']->type, FALSE), ); + $form['content_profile']['content_profile_remove'] = array( + '#type' => 'checkbox', + '#title' => t('Remove nodes of this content type upon user deletion'), + '#default_value' => variable_get('content_profile_remove_' . $form['#node_type']->type, TRUE), + '#description' => t('If ticked, nodes of this content type will be removed when their author user is deleted. If not, only their author will be set to anonymous.'), + ); } elseif (isset($form['#node']) && $form['#node']->type .'_node_form' == $form_id && is_content_profile($form['#node'])) { // Customize the redirect target and buttons of our own node forms. @@ -351,8 +357,14 @@ function _content_profile_node_delete($n } } - // Copied over from node_delete(): + // Bail out early if the node is not to be removed. In this case the default + // user deletion procedure takes it over, so the node will be assigned to + // uid = 0 (anonymous). + if (!variable_get('content_profile_remove_' . $node->type, TRUE)) { + return; + } + // Copied over from node_delete(): db_query('DELETE FROM {node} WHERE nid = %d', $node->nid); db_query('DELETE FROM {node_revisions} WHERE nid = %d', $node->nid);