You are here

function entity_translation_update_7009 in Entity Translation 7

Make sure "i18n_mode" is correctly set for vocabularies having entity translation enabled.

File

./entity_translation.install, line 493
Installation functions for Entity Translation module.

Code

function entity_translation_update_7009() {
  $info = array_filter(variable_get('entity_translation_taxonomy', array()));
  if ($info && module_exists('i18n_taxonomy')) {
    $query = "UPDATE {taxonomy_vocabulary} SET i18n_mode = :et_mode WHERE machine_name IN (:names)";
    $names = array_keys(array_filter($info));
    db_query($query, array(
      ':et_mode' => 32768,
      ':names' => $names,
    ));
  }
}