You are here

function i18nblocks_update_2 in Internationalization 6

Drupal 6 upgrade script.

File

i18nblocks/i18nblocks.install, line 113
Installation file for i18nblocks module.

Code

function i18nblocks_update_2() {
  $ret = array();

  // Rename old table and install new schema
  db_rename_table($ret, 'i18n_blocks', 'i18n_blocks_drupal5');
  drupal_install_schema('i18nblocks');

  // Fill in new table with old blocks but only for user defined blocks.
  // The rest will need manual update
  $ret[] = update_sql("INSERT INTO {i18n_blocks} (module, delta, language) SELECT i.module, i.delta, i.language FROM {i18n_blocks_i18n} i WHERE i.module = 'block'");
  drupal_set_message(t('Multilingual blocks have been updated. Please, review your blocks configuration.'));
  return $ret;
}