After upgrading drupal-6 to drupal-7, I cannot see the body content of a specific content type on his edit page.

after a little research I found out that the column "language" in the "field_data_body" table is set to "und" instead of "en",
so I created a "view" with a VBO field (I need to use VBO because I want to add some filter), and added "execute arbitrary php" operation,
but I dont know how to replace the "und" to "en",

Can someone tell me how to do it?

(Sorry for bad English and thanks!)

Edited: I found the proper code:
db_query("UPDATE field_data_body SET language = REPLACE(language, 'und', 'en') WHERE entity_id = $entity->nid");

Comments

Horroshow’s picture

Same problem happened when I imported content with Feeds module. The "language" in "field_data_body" and other custom fields were incorrectly set to "und". The result is that content appears correctly on the website but not in the edit screens, fields are empty. I corrected the value manually in the database but I can't imagine doing that for all my 1600 nodes.

Is there another way to change set the language per field besides VBO?

Thanks

JSurf’s picture

Just found this thread because i had the same problem. To change all fields set to "und" to your locale you can use the following, no need to do this node by node:

drush sql-query "update field_data_body SET language = 'en' where language = 'und'"