Closed (fixed)
Project:
Drupal core
Version:
x.y.z
Component:
profile.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
9 Jun 2005 at 18:18 UTC
Updated:
23 Jan 2006 at 11:21 UTC
Jump to comment: Most recent file
If you have a field in the profile, and users fill in that field, and later that field is deleted all together, the entry in the profile_fields table is deleted, but the values for that field in profile_values aren't deleted.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | del_profile_values_3.patch | 1.84 KB | Richard Archer |
| #12 | del_profile_values_2.patch | 1.79 KB | Richard Archer |
| #7 | del_profile_values_screen.png | 14.14 KB | Richard Archer |
| #6 | del_profile_values_1.patch | 1.42 KB | Richard Archer |
| #3 | del_profile_values.patch | 867 bytes | DriesK |
Comments
Comment #1
jmengle commentedFound where the field was deleted in profile.module and added a line to delete the field values from profile_values.
Comment #2
Uwe Hermann commentedCan you please provide a proper patch?
Comment #3
DriesK commentedThis is a patch of the db-cleanup code that jmengle added.
Comment #4
moshe weitzman commentedplease provide big red warning to admins before they do this. this is a very destructive operation.
Comment #5
Bèr Kessels commenteda default confirmation should do, imo.
Comment #6
Richard Archer commentedHere's a revised patch that:
I shall attach a screen grab on another post.
Comment #7
Richard Archer commentedScreen grab of confirmation page.
Comment #8
Steve Dondley commentedyou help text suggests making the fields hidden. How is it possible to make a profile field hidden?
Comment #9
Steve Dondley commentedAh, OK, not hidden like a hidden HTML field. You'r talking about visibility setting in the profile module's field editing screen that says "Hidden profile field, only accessible by administrators, modules and themes."
I'd +1 this if you make that more clear and where this setting can be changed.
Comment #10
Richard Archer commentedHey Steve,
Thanks for having a look at this patch. And a BIG thank you for taking the time to work out what I was talking about in that help text :)
Here's a new patch that applies cleanly against HEAD. The old patch was hit by the new forms API.
I have improved the warning message that appears once you hit "delete". It now reads:
Are you sure you want to delete the field Example?
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 edit this field and change it to a "hidden profile field".
The text "edit this field" is a link to the admin page where they can change the type of the field.
Comment #11
Richard Archer commentedHmm... can't upload the patch.
I'll upload it here when the site problem is fixed.
But here it is, for now:
http://mel01.juggernaut.com.au/del_profile_values_2.patch
Comment #12
Richard Archer commentedPatch attached.
Comment #13
Richard Archer commentedHere's a new version of this patch that applies cleanly and fixes some code style issues.
Comment #14
killes@www.drop.org commentedLooks good, works as adertised.
Comment #15
dries commentedGreat team work guys. Committed to HEAD. Thanks.
Comment #16
dries commented