You are here

function hosting_alias_update_6204 in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 alias/hosting_alias.install \hosting_alias_update_6204()
  2. 7.3 alias/hosting_alias.install \hosting_alias_update_6204()

Fixup redirection data after table change in hosting_alias_update_6203()

File

alias/hosting_alias.install, line 101
Install, update and uninstall for the site aliases module.

Code

function hosting_alias_update_6204() {
  $ret = array();
  $result = db_query("SELECT alias.nid FROM {hosting_site_alias} alias INNER JOIN {hosting_site} site ON site.nid = alias.nid WHERE redirection=1 AND site.status>-2");
  while ($obj = db_fetch_object($result)) {
    $node = node_load($obj->nid);
    if (is_object($node)) {
      $node->redirection = $node->title;
      hosting_alias_update($node);

      // Run a verify task to update the vhost
      hosting_add_task($node->nid, 'verify');
    }
  }
  return $ret;
}