You are here

function hosting_package_update_9 in Hostmaster (Aegir) 6

Regenerate the package version codes to fix a error related to the regular expression

File

modules/hosting/package/hosting_package.install, line 283
Install, update and uninstall for the package management module.

Code

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

  // This code was originally in update 8, but was moved here to avoid people executing the same functionality
  // twice.
  $result = db_query("SELECT iid, version FROM {hosting_package_instance}");
  while ($obj = db_fetch_object($result)) {
    $code = hosting_package_instance_version_code($obj->version);
    db_query("UPDATE {hosting_package_instance} SET version_code = %f WHERE iid = %d", $code, $obj->iid);
  }
  return $ret;
}