diff --git a/site/hosting_site.nodeapi.inc b/site/hosting_site.nodeapi.inc index 2ea0d3e..6458f38 100644 --- a/site/hosting_site.nodeapi.inc +++ b/site/hosting_site.nodeapi.inc @@ -302,6 +302,12 @@ function hosting_site_insert(&$node) { } $node->platform = $node->platform_node->nid; } + + // If db_server hasn't been explicity set, use hostmaster's web server. + if (!isset($node->platform_node->db_server)) { + $hostmaster = hosting_context_load('hostmaster'); + $node->db_server = $hostmaster->db_server; + } } // If there is no platform NID and no publish path, throw an exception. @@ -309,12 +315,6 @@ function hosting_site_insert(&$node) { throw new Exception('Site nodes require either platform or platform_node->publish_path property'); } - // If db_server hasn't been explicity set, use hostmaster's web server. - if (!isset($node->platform_node->db_server)) { - $hostmaster = hosting_context_load('hostmaster'); - $node->db_server = $hostmaster->db_server; - } - $id = db_insert('hosting_site') ->fields(array( 'vid' => $node->vid,