When a server has no available services, warnings are thrown since $node->services, which is populated in hosting_server_init_services(), is missing. Patch attached that initializes $node->services as an empty array.

  • warning: Invalid argument supplied for foreach() in /profiles/hostmaster/modules/hosting/server/hosting_server.module on line 182.
  • warning: Invalid argument supplied for foreach() in /profiles/hostmaster/modules/hosting/server/hosting_server.module on line 422.

Also fixed a typo in the function's docblock, and added some additional doxygen info.

CommentFileSizeAuthor
server-no-services.patch1.36 KBmr.baileys

Comments

anarcat’s picture

Status: Needs review » Fixed

Committed to head. I have rerolled the patch as it was introducing whitespace errors:

anarcat@desktop006:hostmaster$ curl http://drupal.org/files/issues/server-no-services.patch | git apply
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
106  1388  106  1388    0     0   6669      0 --:--:-- --:--:-- --:--:-- 13094
<stdin>:22: trailing whitespace.
 *   $node The server node object.
warning: 1 line adds whitespace errors.
anarcat’s picture

Also merged in the stable branch because of the API documentation.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.