Given the current structure of Table “profile_fields” (shown with sample data);
fid,title,name,explanation,category,page,type,weight
1,Country,profile_Location_Country,**desc removed**,Location Information,null,selection,0
2,State,profile_Location_State,**desc removed**,Location Information,null,selection,1
3,County,profile_profile_Location_County,**desc removed**,Location Information,null,selection,3
4,Type,profile_Vehicle_Type,**desc removed**,Vehicle Information,null,selection,-5
5,Year,profile_Vehicle_Year,**desc removed**,Vehicle Information,null,textfield,-4
6,Manufacturer,profile_Vehicle_Make,**desc removed**,Vehicle Information,null,selection,-3
7,Model,profile_Vehicle_Model,**desc removed**,Vehicle Information,null,textfield,-2
8,Color(s),profile_Vehicle_Colors,**desc removed**,Vehicle Information,null,list,-1
9,Special Features,profile_Vehicle_SpecialFeatures,**desc removed**,Vehicle Information,null,list,0
10,Engine Manufacturer,profile_Vehicle_EngineManufacturer,**desc removed**,Vehicle Information,null,selection,1
11,Engine Features,profile_profile_Vehicle_EngineFeatures,**desc removed**,Vehicle Information,null,list,2
19,Number of Cylinders,profile_Vehicle_EngineCylinders,**desc removed**,Vehicle Information,null,textfield,3
13,Cubic Inches,profile_Vehicle_EngineCubicInches,**desc removed**,Vehicle Information,null,textfield,4
14,Transmission,profile_Vehicle_Transmission,**desc removed**,Vehicle Information,null,textfield,4
15,Owner Comments,profile_Owner_Comments,**desc removed**,Vehicle Information,null,textarea,5
16,Club Member,profile_CarClub_MCCC_YesNo,**desc removed**,Club Affiliation,null,checkbox,0
17,Other Car Clubs,profile_CarClub_Names,**desc removed**,Club Affiliation,null,list,1
18,Other Club Home Pages,profile_CarClub_HomePages,**desc removed**,Club Affiliation,null,textarea,2
Under this structure, the “weight” attribute applies to the “field order” within a category. There is no place to put the “weight” that would apply to the “category” attribute. This impacts the ability to control placement of “groups” on the “…/user/register” page. ( See issue # xxxxxxx )
An alternative “design” would be to normalize the table by changing the category attribute to a foreign key to the category_id in a new table named “profile_category”. The new / changed structures are shown as ( with sample data ):
1. table “profile_category”
cid,category_description,category_weight
1, “Location Information”,2
2, “Vehicle Information”,3
3, “Club Affiliation”,1
2. table ““profile_category_field”
fid,title,name,explanation,category_id,page,type,weight
1,Country,profile_Location_Country,**desc removed**,1,null,selection,0
2,State,profile_Location_State,**desc removed**,1,null,selection,1
3,County,profile_profile_Location_County,**desc removed**,1,null,selection,3
4,Type,profile_Vehicle_Type,**desc removed**,2,null,selection,-5
5,Year,profile_Vehicle_Year,**desc removed**,2,null,textfield,-4
6,Manufacturer,profile_Vehicle_Make,**desc removed**,2,null,selection,-3
7,Model,profile_Vehicle_Model,**desc removed**,2,null,textfield,-2
8,Color(s),profile_Vehicle_Colors,**desc removed**,2,null,list,-1
9,Special Features,profile_Vehicle_SpecialFeatures,**desc removed**,2,null,list,0
10,Engine Manufacturer,profile_Vehicle_EngineManufacturer,**desc removed**,2,null,selection,1
11,Engine Features,profile_profile_Vehicle_EngineFeatures,**desc removed**,2,null,list,2
19,Number of Cylinders,profile_Vehicle_EngineCylinders,**desc removed**,2,null,textfield,3
13,Cubic Inches,profile_Vehicle_EngineCubicInches,**desc removed**,2,null,textfield,4
14,Transmission,profile_Vehicle_Transmission,**desc removed**,2,null,textfield,4
15,Owner Comments,profile_Owner_Comments,**desc removed**,2,null,textarea,5
16,Memory Chasers Member,profile_CarClub_MCCC_YesNo,**desc removed**,3,null,checkbox,0
17,Other Car Clubs,profile_CarClub_Names,**desc removed**,3,null,list,1
18,Other Club Home Pages,profile_CarClub_HomePages,**desc removed**,3,null,textarea,2
This now provides the proper weight for controlling “sort order” for the categories.
In core module “profile.module” in function “_profile_get_fields” , the current SQL would need to use a join to the “profile_category” table to retrieve the “category description” and the “category_weight” data.
Of course, there would also be changes required to the form that does the “add/change/delete” for profile fields process that populates and updates the tables (“…/admin/user/profile”).
This design change would allow for cleaner solutions to issues like:
1. Improper placement of “field category groups” on new user registration page, issue # )
I am submitting this as a bug ( since it causes a direct problem in useability ) to open for discussion on solution.
Dave
Comments
Comment #1
dnuss commentedThis design change would allow for cleaner solutions to issues like:
1. Improper placement of “field category groups” on new user registration page, issue http://drupal.org/node/124641 )
Comment #2
dnuss commentedrefernce to table “profile_category_field” should be table “profile_fields” in above outline item "2." which shows the existing table after the suggested changes.
Comment #3
robin monks commentedMoving to HEAD, also, I would consider this a feature request.
Robin
Comment #4
damien tournoud commentedThe profile module is obsolete. Won't fix.