Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.5
Component:
General
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2007 at 01:15 UTC
Updated:
15 Jun 2011 at 10:55 UTC
I am using 5.x and have named some CCK fields and then changed the labels such that the field names and label do not correspond well.
Does anybody know the steps to change a field name either in Drupal or Directly in DB. I expect I may have to change in several tables of the DB but was not sure.
Thanks in advance
Comments
Comment #1
tmj2k7 commentedAre you using the Content module to create new content types? The field manager should allow you do do that in admin/content/types
Comment #2
mjs-1 commentedThanks for the reply. The configure screen allows me to change the field label but not the field name.
I would like to know how to change the field name.
Comment #3
yched commentedCCK does not provide any UI to do that, since it's not supposed to be a feature.
if you really need to, the steps to do that manually in the db are :
Say you want to rename field_old_name to field_new_name
0- backup you db :-)
1- edit the relevant value in {node_field}.field_name - there should be one line
2- edit the relevant values in {node_field_instance}.field_name and {node_group_fields}.field_name (if you have enabled fieldgroup.module) - there could be several lines to alter
if the field is multiple or shared between several content types
3a- data table is {content_field_old_name}. rename it to {content_field_new_name}
if the field is single or not shared
3b- data table is {content_type_(the_content_type)}; Don't rename
4- in the data table, rename the field_old_name_* columns to field_new_name_*
5- empty tables {cache}, {cache_content} and {cache_views} (if using Views 1.6+)
6- Visit your site and check the results :-) - you'll probably need to resave your the views that refer to the field
Comment #4
yched commentedsupport was given
Comment #5
killes@www.drop.org commentedComment #6
pvanerk commentedYou can also try the module CCK Field Rename: http://drupal.org/project/cck_field_rename