Here is a patch to return the nid of the new site after adding a site with hosting_services_save_site.

This will vastly simplify a remote site's ability to follow up with the state of a new site once the request to create the new site has been done.

Comments

liam mcdermott’s picture

Status: Needs review » Needs work

Thanks very much for the patch! Here's a quick review:

+++ b/hosting_services.site.incundefined
@@ -40,7 +40,9 @@ function hosting_services_save_site($url, $data) {
+  node_save($site); ¶

There's a space at the end of this line.

+++ b/hosting_services.site.incundefined
@@ -40,7 +40,9 @@ function hosting_services_save_site($url, $data) {
+  return @$node->nid;

Should this be:

return @$site->nid;

?

Also, the error suppression there is a bit ugly. Maybe we should check whether the nid is set, return it if yes or return FALSE otherwise. Is that a good idea?

kala4ek’s picture

Status: Needs work » Needs review
StatusFileSize
new607 bytes

I think that function should return node object.

gboudrias’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

The 6.x-2.x branch is deprecated along with Drupal 6.

If this remains a confirmed issue in 7.x-3.x, feel free to re-open, or better yet, create a new issue referencing this one.