While working on my site and adding CCK fields and groups to a particular node, I realized I messed up the machine-readable names for some of them...but when I went to try and fix them, I couldn't find anything in that node's CCK settings to do this.

I then decided to fix it via phpMyAdmin, running a search to see what I needed to change. The "field_name" field in the "node_field" and "node_field_instance" tables was the only place I could find that field name. I changed that field in both tables to what I wanted, and saved those changes. When I did so, I made sure they followed the same format as their original names, and were identical (as that field name was the same in both tables).

After doing that, I tried submitting a sample node using the CCK fields I created earlier...but now I get this particular error, once for each field that was changed in phpMyAdmin (I've substituted variables in place of the fields that may differ):

* user warning: Unknown column 'field_<field_name>_value' in 'field list' query: SELECT field_<field_name>_value AS value, field_<field_name>_value2 AS value2 FROM content_type_<node_type> WHERE vid = <vid> LIMIT 0, 1 in <path_to>/drupal/includes/database.mysql.inc on line 172.

When updating that node, I get similar errors (again, once for each of those fields):

user warning: Unknown column 'field_<field_name>_value' in 'field list' query: UPDATE content_type_<node_type> SET field_<field_name>_value = <data>, field_<field_name>_value2 = <data> WHERE vid = <vid> AND nid = <nid> in <path_to>/drupal/includes/database.mysql.inc on line 172.

Those fields won't be visible in the submitted node, and when editing it, those fields revert to their original values (usually blank).

I'm really not sure what I can do to fix this. Have I missed changing a field somewhere? Should I attempt to revert those field names to what they originally were? Or should I just delete those fields and re-create them?

Thank you for any help you can provide in regard to this issue.

Comments

Wolfey’s picture

Status: Active » Fixed

Looks like I did miss one after all - the names of the fields in the "content_type_<node_type>" table were still using the old values.

Changing those field names to the new ones (making sure they started with "field_" and, depending on the case, ended with "_value" or "_value2") fixed this issue - the data in those fields is now saved, and the errors are gone.

Anonymous’s picture

Status: Fixed » Closed (fixed)