diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-01-08 12:06:13 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-01-08 12:06:13 +0000 |
commit | 68ced8da595a90abfcda774a1bffddb65ec588e5 (patch) | |
tree | 6bd680f83db09f5a564bb59ae2407c94fa798e53 | |
parent | ef0e3ffb4453a178ce42105e0a003007f2ac398b (diff) | |
download | brdo-68ced8da595a90abfcda774a1bffddb65ec588e5.tar.gz brdo-68ced8da595a90abfcda774a1bffddb65ec588e5.tar.bz2 |
- Patch #24678 by jmengle, DriesK, Richard et al: bugfix: deleting a profile field doesn't delete values in profile_values table.
-rw-r--r-- | modules/profile.module | 10 | ||||
-rw-r--r-- | modules/profile/profile.module | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/modules/profile.module b/modules/profile.module index 6db0b3068..fe631a568 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -551,14 +551,18 @@ function profile_admin_delete($fid) { $field = db_fetch_object(db_query("SELECT title FROM {profile_fields} WHERE fid = %d", $fid)); if ($_POST['edit']['confirm']) { db_query('DELETE FROM {profile_fields} WHERE fid = %d', $fid); + db_query('DELETE FROM {profile_values} WHERE fid = %d', $fid); cache_clear_all(); drupal_set_message(t('The field %field has been deleted.', array('%field' => theme('placeholder', $field->title)))); drupal_goto('admin/settings/profile'); } else { - return confirm_form('profile_confirm_delete', $form, t('Do you want to remove the field %field?', - array('%field' => $field->title)), - 'admin/settings/profile', '', t('Delete'), t('Cancel')); + return confirm_form('profile_confirm_delete', $form, + t('Are you sure you want to delete the field %field?', array('%field' => theme('placeholder', $field->title))), + 'admin/settings/profile', + t('This action cannot be undone. If users have entered values into this field in their profile, these entries will also be deleted. If you want to keep the user-entered data, instead of deleting the field you may wish to <a href="%edit-field">edit this field</a> and change it to a \'hidden profile field\' so that it may only be accessed by administrators.', array('%edit-field' => url('admin/settings/profile/edit/' . $fid))), + t('Delete'), + t('Cancel')); } } diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 6db0b3068..fe631a568 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -551,14 +551,18 @@ function profile_admin_delete($fid) { $field = db_fetch_object(db_query("SELECT title FROM {profile_fields} WHERE fid = %d", $fid)); if ($_POST['edit']['confirm']) { db_query('DELETE FROM {profile_fields} WHERE fid = %d', $fid); + db_query('DELETE FROM {profile_values} WHERE fid = %d', $fid); cache_clear_all(); drupal_set_message(t('The field %field has been deleted.', array('%field' => theme('placeholder', $field->title)))); drupal_goto('admin/settings/profile'); } else { - return confirm_form('profile_confirm_delete', $form, t('Do you want to remove the field %field?', - array('%field' => $field->title)), - 'admin/settings/profile', '', t('Delete'), t('Cancel')); + return confirm_form('profile_confirm_delete', $form, + t('Are you sure you want to delete the field %field?', array('%field' => theme('placeholder', $field->title))), + 'admin/settings/profile', + t('This action cannot be undone. If users have entered values into this field in their profile, these entries will also be deleted. If you want to keep the user-entered data, instead of deleting the field you may wish to <a href="%edit-field">edit this field</a> and change it to a \'hidden profile field\' so that it may only be accessed by administrators.', array('%edit-field' => url('admin/settings/profile/edit/' . $fid))), + t('Delete'), + t('Cancel')); } } |