Closed (fixed)
Project:
Hosting
Version:
6.x-0.4-alpha3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jun 2011 at 16:02 UTC
Updated:
12 Jun 2014 at 08:59 UTC
Jump to comment: Most recent
In hosting_platform.module we have:
$servers = hosting_get_servers('http');
if (sizeof($servers) > 1) {
$form['web_server'] = array(
'#type' => 'radios',
'#title' => t('Web server'),
'#description' => t('The web server the sites will be hosted on.'),
'#options' => $servers,
'#default_value' => ($node->web_server) ? $node->web_server : HOSTING_DEFAULT_WEB_SERVER,
);
}
else {
$form['web_server'] = array('#type' => 'hidden', '#value' => key($servers));
}
I added a hook for the hosting_get_servers function the other day in #1189398: Add friendly name for Servers, and if you implement it and add a foreach over the array of servers, this then breaks the key($servers), as that will return <NULL.
Either, we change everywhere we use the results of hosting_get_servers to not be silly, or we always reset the array pointer in hosting_get_servers.
I prefer the former. Thoughts?
Comments
Comment #1
steven jones commentedActually it was only used like this in the one place, awesome!
Fixed in both branches.