You are here

function nodewords_update_6180 in Nodewords: D6 Meta Tags 6

Update old versions to 6.x-1.13-x. We had to jump to 6180 because 6.x-1.12- releases had already jumped to 6179, so updating would try running *all* updates and could potentially break the site.

File

./nodewords.install, line 1589
Installation file for nodewords.module.

Code

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

  // Work out what the last version was.
  $old_rev = intval(db_result(db_query("SELECT schema_version FROM {system} WHERE name='nodewords'")));

  // Updating from a 6.x-1.12-x release.
  if ($old_rev == 6179) {
    drupal_set_message(t('You are updating from 6.x-1.12. A lot of code has been reverted, specifically the Tokens support has temporarily been removed. You should not have lost any data, but please be aware that any meta tags which depended upon Tokens will not work correctly. As a temporary solution you may wish to test the <a href="@v2alpha1">6.x-2.0-alpha1</a> version, until <a href="@tokens_link">Token support can be added to 6.x-1.x again</a>.', array(
      '@v2alpha1' => 'http://drupal.org/node/1145986',
      '@tokens_link' => 'http://drupal.org/node/1380362',
    )));
    $ret[] = update_sql("DELETE FROM {system} WHERE name IN ('nodewords_ui')");
    $ret[] = update_sql("DELETE FROM {system} WHERE name IN ('nodewords_admin')");
    $ret[] = update_sql("DELETE FROM {system} WHERE name IN ('nodewords_tokens')");
    $ret[] = update_sql("DELETE FROM {system} WHERE name IN ('nodewords_custom_pages')");
    $ret[] = array(
      'success' => TRUE,
      'query' => 'Some of the redundant submodules from the 6.x-1.12 codebase have been removed, though their variables have been left for future use.',
    );
  }
  return $ret;
}