You are here

function hosting_package_update_9 in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 package/hosting_package.install \hosting_package_update_9()
  2. 7.3 package/hosting_package.install \hosting_package_update_9()

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

File

package/hosting_package.install, line 288
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;
}