Commit ebe039ca authored by mikeytown2's avatar mikeytown2

Issue #1874764 by mikeytown2: displayed default values come from the defined constants.

parent 78c29eb4
......@@ -26,31 +26,31 @@ function httprl_admin_settings_form() {
'#type' => 'textfield',
'#title' => t('dns_timeout. Maximum number of seconds a DNS lookup request may take'),
'#default_value' => variable_get('httprl_dns_timeout', HTTPRL_DNS_TIMEOUT),
'#description' => t('Value can be a float. The default is 5 seconds. '),
'#description' => t('Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_DNS_TIMEOUT)),
);
$form['timeous']['httprl_connect_timeout'] = array(
'#type' => 'textfield',
'#title' => t('connect_timeout. Maximum number of seconds establishing the TCP connection may take'),
'#default_value' => variable_get('httprl_connect_timeout', HTTPRL_CONNECT_TIMEOUT),
'#description' => t('Value can be a float. The default is 5 seconds.'),
'#description' => t('Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_CONNECT_TIMEOUT)),
);
$form['timeous']['httprl_ttfb_timeout'] = array(
'#type' => 'textfield',
'#title' => t('ttfb_timeout. Maximum number of seconds a connection may take to download the first byte'),
'#default_value' => variable_get('httprl_ttfb_timeout', HTTPRL_TTFB_TIMEOUT),
'#description' => t('Value can be a float. The default is 20 seconds.'),
'#description' => t('Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_TTFB_TIMEOUT)),
);
$form['timeous']['httprl_timeout'] = array(
'#type' => 'textfield',
'#title' => t('timeout. Maximum number of seconds the request may take'),
'#default_value' => variable_get('httprl_timeout', HTTPRL_TIMEOUT),
'#description' => t('Value can be a float. The default is 30 seconds.'),
'#description' => t('Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_TIMEOUT)),
);
$form['timeous']['httprl_global_timeout'] = array(
'#type' => 'textfield',
'#title' => t('global_timeout. Maximum number of seconds httprl_send_request() may take'),
'#default_value' => variable_get('httprl_global_timeout', HTTPRL_GLOBAL_TIMEOUT),
'#description' => t('Value can be a float. The default is 120 seconds.'),
'#description' => t('Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_GLOBAL_TIMEOUT)),
);
......@@ -62,7 +62,7 @@ function httprl_admin_settings_form() {
*/
function httprl_admin_settings_form_validate($form, &$form_state) {
// Skip validation if we are resting to defaults.
if ($form_state['clicked_button']['#post']['op'] == 'Reset to defaults') {
if (isset($form_state['clicked_button']['#post']['op']) && $form_state['clicked_button']['#post']['op'] == 'Reset to defaults') {
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment