Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fix translated node bodies after an import from feeds in Drupal 7
delete i from field_data_body as b join node as n on n.vid=b.revision_id join field_data_body as i on n.vid=i.revision_id WHERE n.language="en" AND b.language="und" and i.language = 'en';
UPDATE IGNORE field_data_body as b join node as n on n.vid=b.revision_id SET b.language="en" WHERE n.language="en" AND b.language="und";
delete i from field_data_body as b join node as n on n.vid=b.revision_id join field_data_body as i on n.vid=i.revision_id WHERE n.language="es" AND b.language="und" and i.language = 'es';
UPDATE IGNORE field_data_body as b join node as n on n.vid=b.revision_id SET b.language="es" WHERE n.language="es" AND b.language="und";
delete i from field_data_body as b join node as n on n.vid=b.revision_id join field_data_body as i on n.vid=i.revision_id WHERE n.language="ar" AND b.language="und" and i.language = 'ar';
UPDATE IGNORE field_data_body as b join node as n on n.vid=b.revision_id SET b.language="ar" WHERE n.language="ar" AND b.language="und";
delete i from field_data_body as b join node as n on n.vid=b.revision_id join field_data_body as i on n.vid=i.revision_id WHERE n.language="fr" AND b.language="und" and i.language = 'fr';
UPDATE IGNORE field_data_body as b join node as n on n.vid=b.revision_id SET b.language="fr" WHERE n.language="fr" AND b.language="und";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment