function hosting_package_update_9 in Hosting 7.4
Same name and namespace in other branches
- 6.2 package/hosting_package.install \hosting_package_update_9()
- 7.3 package/hosting_package.install \hosting_package_update_9()
Implements hook_update_N().
Regenerate the package version codes to fix a error related to the regular expression
File
- package/
hosting_package.install, line 304 - Define database schema and update functions 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;
}