help overcoming d7 cck migrate fields multilingual update bug

Events happening in the community are now at Drupal community events on www.drupal.org.
cpelham's picture

I need help overcoming a bug in D7 CCK migrate fields, which fails to set the language which makes the field data not show up on edit screens of multilingual sites.

I'm not knowledgeable enough to patch the module and so far no one in the issue queue has helped. Maybe I have almost written a query that could be run directly in phpmyadmin though. Can anyone help me correct this syntax (assuming you can run if/then statements directly in mysql queries)? There must be a LOT of multiilingual sites that cannot upgrade to d7 without this:

select nid, language from i18n_node;
if (i18n_node language = 'ja')
then
update field_data_field_myfield = replace(language, 'und','ja') where field_data_field_myfield nid = i18n_node nid

Comments

If/then doesn't work

jtbayly's picture

You can't use an if/then in a SQL query, but you shouldn't need it. Just move the condition to the end like this:
UPDATE .... WHERE .... AND i18n_node language = 'ja'

Conditions can be strung together with AND statements like that. I don't have any clue what the query that will actually work is. I'm just explaining how to get around the need for if/then in SQL.

I hope that helps.