function hosting_platform_update in Hosting 7.3
Same name and namespace in other branches
- 5 platform/hosting_platform.module \hosting_platform_update()
- 6.2 platform/hosting_platform.module \hosting_platform_update()
- 7.4 platform/hosting_platform.module \hosting_platform_update()
Implements hook_update().
As an existing node is being updated in the database, we need to do our own database updates.
File
- platform/
hosting_platform.module, line 553 - Platform node type definition.
Code
function hosting_platform_update($node) {
// If this is a new node or we're adding a new revision.
if (!empty($node->revision)) {
hosting_platform_insert($node);
}
else {
if ($node->platform_status == HOSTING_PLATFORM_DELETED) {
$node->no_verify = TRUE;
}
db_update('hosting_platform')
->fields(array(
'publish_path' => hosting_path_normalize($node->publish_path),
'makefile' => isset($node->makefile) ? $node->makefile : (isset($node->frommakefile['makefile']) ? $node->frommakefile['makefile'] : ''),
'web_server' => $node->web_server,
'verified' => $node->verified,
'status' => $node->platform_status,
'make_working_copy' => isset($node->frommakefile['make_working_copy']) ? $node->frommakefile['make_working_copy'] : $node->make_working_copy,
))
->condition('nid', $node->nid)
->execute();
}
if (!isset($node->no_verify)) {
hosting_add_task($node->nid, 'verify');
}
}