Follow-up for: #1681904: Ability to configure a url to redirect to in site configuration.

The redirection field has changed from an int to a varchar.
Sites that have not been edited recently can still have a '1' value, letting the site redirect to http://1/.

I think this update hook will fix the issue, but I'll try t verify in the coming week.

/**
 * Fixup redirection data after table change in hosting_alias_update_6203()
 */
function hosting_alias_update_6204() {
  $ret = array();
  $result = db_query("SELECT `nid` FROM {hosting_site_alias} WHERE `redirection`=1");
  while ($obj = db_fetch_object($result)) {
    $node = node_load($obj->nid);
    if (is_object($node)) {
      $node->redirection = $node->title;
      hosting_alias_update($node);
    }
  }

  return $ret;
}

Comments

helmo’s picture

Project: Hostmaster (Aegir) » Hosting
Status: Active » Needs review
StatusFileSize
new881 bytes

Tested on another system, and added:

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

anarcat’s picture

go go go.

anarcat’s picture

Status: Needs review » Fixed

actually, i just pushed this already.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 7954627 on 6.x-2.x, 7.x-3.x, dev/1212086, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x authored by helmo, committed by ergonlogic:
    Issue #2010064 by helmo: Fixed old redirection aliases.
    
  • Commit b70cb5f on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x authored by helmo, committed by anarcat:
    Issue #2010064 by helmo: Fixed old redirection aliases.
    

  • Commit 7954627 on 6.x-2.x, 7.x-3.x, dev/1212086, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x authored by helmo, committed by ergonlogic:
    Issue #2010064 by helmo: Fixed old redirection aliases.
    
  • Commit b70cb5f on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x authored by helmo, committed by anarcat:
    Issue #2010064 by helmo: Fixed old redirection aliases.